Results 1 to 4 of 4
  1. #1
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368

    Double dlookup failing

    Dear programmers,



    In having trouble combining two dlookups.
    The first dlookup checks of a date in a certain field is greater the todays date, this works as intended.
    But when i add another to check if the datestring is empty it fails.

    Code:
    If DLookup("Miva_tot", "tblMinderValide", "Pnummer = '" & Me.Pnummer & "'") >= Date Or DLookup("Miva_tot", "tblMinderValide", "Pnummer = '" & Me.Pnummer & "'") = "" Then 
            Me.slvMIVA = True
            Else
            Me.slvMIVA = False
    I tried is Null, "0" and "" but on any occasion it returns false while the record selected should return true

    Greetings,

    Jeroen

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Try

    IsNull(DLookup(...))
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    Hi Paul,

    It works !
    Thanks a million

    Greetings, Jeroen

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Updateable query failing in Runtime - 2010
    By ChefContainer in forum Queries
    Replies: 1
    Last Post: 02-05-2013, 07:29 PM
  2. Execute Excel Macro from Access failing
    By dcgrove in forum Programming
    Replies: 1
    Last Post: 12-22-2011, 02:14 PM
  3. Export to Excel failing
    By JChalmers in forum Import/Export Data
    Replies: 1
    Last Post: 11-11-2011, 11:02 AM
  4. Append to SQL table failing on data type
    By tpcervelo in forum Queries
    Replies: 2
    Last Post: 10-13-2011, 12:07 PM
  5. Failing on my database miserably
    By jmathews004 in forum Access
    Replies: 6
    Last Post: 04-11-2010, 03:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums