Results 1 to 4 of 4
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Subform Master-Child Link Doesn't Work? (2003)

    Upon opening the attached mdb file I get the error message:
    <font color=red>Run-time error '3075', Syntax error in date in query expression 'Giorno = ##'</font color=red>
    and if I click the Debug button, the code line highlighted is
    <span style="background-color: #FFFF00; color: #000000; font-weight: bold"> Me.primo = DLookup("primo", "personale", "Giorno = #" & Format(Me.Giorno, "mm/dd/yyyy") & "#")</span hi>
    for the Current event of the FPersonale form.
    I can see that if I hover the mouse over Me.Giorno in the above line, the ToolTip message says Me.Giorno=Null.
    The FPersonale form is a subform of the Maschera10 form as is the FrmMeteo form but why then Me.Giorno has a value in the equivalent line for the Current event of the FrmMeteo form?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subform Master-Child Link Doesn't Work? (2003)

    There are always timing problems between forms and subforms when opening a form. Try this:

    If Not IsNull(Me.Giorno) Then
    Me.primo = DLookup("primo", "personale", "Giorno = #" & Format(Me.Giorno, "mm/dd/yyyy") & "#")
    Me.secondo = DLookup("secondo", "personale", "Giorno = #" & Format(Me.Giorno, "mm/dd/yyyy") & "#")
    Me.terzo = DLookup("terzo", "personale", "Giorno = #" & Format(Me.Giorno, "mm/dd/yyyy") & "#")
    Me.II

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Master-Child Link Doesn't Work? (2003)

    Thank you Hans, that's better but why now, when you click on the Meteo/Personale tab, the FPersonale subform displays a pencil on the row selector while the FrmMeteo subform doesn't?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subform Master-Child Link Doesn't Work? (2003)

    Because the lines

    Me.primo = ...

    modify the current record.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •