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

    Synchronised form Doesn't Show Data (2003)

    If, on the startup form of the attached mdb, you select March 21, 2006 on the calendar and click the "Counter readings" button, the Reading form that comes up shows no data.
    The READINGS table, which is part of the Reading form record source, does contain the 21 March 2006 date so why is nothing displayed?

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

    Re: Synchronised form Doesn't Show Data (2003)

    C'mon Giorgio! You should know why

    strWhere = "giorno = " & Forms!Prev!CGior

    is not valid.

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

    Re: Synchronised form Doesn't Show Data (2003)

    <img src=/S/blush.gif border=0 alt=blush width=15 height=15> <img src=/S/stupidme.gif border=0 alt=stupidme width=30 height=30>

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

    Re: But then again...

    Both

    strWhere = "giorno = #" & Format(Forms!Prev!CGior, "mm/dd/yyyy") & "#" ... (A)

    and

    strWhere = "giorno = Forms!Prev!cgior" ... ([img]/forums/images/smilies/cool.gif[/img]

    are valid, but

    strWhere = "giorno = " & Forms!Prev!cgior ...

    is *not* valid.

    In ([img]/forums/images/smilies/cool.gif[/img], giormo is compared directly to the value of Forms!Prev!cgior because Forms!Prev!cgior is inside the quotes, and it works because Access knows how to deal with controls on forms. However, ([img]/forums/images/smilies/cool.gif[/img] would not be valid for use in DAO or ADO, since they don't "know" about forms and controls. So I generally use (A) even if it is a bit more work. I can use the expression in Access, DAO and ADO without modification.

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

    But then again...

    I've modified the Where condition in the OpenForm method from
    strWhere = "giorno = " & Forms!Prev!cgior
    to
    strWhere = "giorno = #" & Format(Forms!Prev!CGior, "mm/dd/yyyy") & "#"
    and now the Reading form shows the data
    but
    why does the COPIA DI PREV form, that opens when you click the "Production readings" button, displays the data even if you use
    strWhere = "giorno = Forms!Prev!cgior"
    as Where condition of the OpenForm method?

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

    Re: But then again...

    Thank you Hans,
    How come if I select March 22, 2006 on the calendar and click the "Counter readings" button, the Reading form displays nothing in spite of the fact the Readings table has records for that date?

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

    Re: But then again...

    But Varie doesn't, and the Reading form is based (via QRead) on Readings and Varie, joined on Giorno.

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

    Re: But then again...

    Thank you Hans <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

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