Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Filter on Null (2002)

    Hi,

    I'm trying to get [lstname] to either show all records if there are not dates in [txtFromDate] and [txtToDate] or to only show the records that are between [txtFromDate] and [txtToDate]. I've tried setting up the query similar to one that was given to me a few months ago for a different database but can't get it to work no matter what I do. I'm attatching a stripped down version.

    Thanks,
    Leesha

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

    Re: Filter on Null (2002)

    You refresh the list box, but the row source of the list box is not dependent on the values of the text boxes, so nothing changes. Change the row source of the list box to

    SELECT tblCallBackSurvey.ID, tblCallBackSurvey.[Patient Name], tblCallBackSurvey.[Date Received By Office] FROM tblCallBackSurvey WHERE (tblCallBackSurvey.[Date Received By Office]>=Forms!frmCallbackLookup!txtFromDate Or Forms!frmCallbackLookup!txtFromDate Is Null) And (tblCallBackSurvey.[Date Received By Office]<=Forms!frmCallbackLookup!txtToDate Or Forms!frmCallbackLookup!txtToDate Is Null) ORDER BY tblCallBackSurvey.[Patient Name]

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Filter on Null (2002)

    Thanks Hans! I was trying to set it up with something remotely (and I mean very remotely) similar to what you gave me but was nowhere near the course!

    BTW, congratuations on your achievement with the number of posts that you have reached! I know I wouldn't be anywhere with Access without your help.

    Leesha

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

    Re: Filter on Null (2002)

    Thanks!

    Another way would be to change the row source of the list box in the On Click event of the command button, but if it works now, I'd stay with what you have.

Posting Permissions

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