Results 1 to 3 of 3
  1. #1
    tim_tims33 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Dec 2011
    Posts
    62

    How to handle multiple null values using form-based parameter queries?

    Hi, i'm creating a search form giving the end user a range of controls to use when filtering/searching data. See the image.

    But, i think my range search (using the textbox) to put in a lower and upper limit...is preventing this from working. In fact, when i put data into all the controls, no data pops up in my subform. How can i get around this?

    My query data source can also be seen...showing you how i've handled teh null entries. (Hmmm..perhaps i need to put in a null 'handler' for the two textboxes??)



    Please advise where you can...

    Many thanks
    tim
    Attached Thumbnails Attached Thumbnails SearchForm.jpg   QuerySource.jpg  

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    LIKE operator is only useful with wildcards: LIKE [Forms]![frmSearch]![txtSurnameSearch] & "*"

    Is [Member ID] a text or number?

    Why are the controls under the [Member ID] field named with 'StartDate' and 'EndDate'?

    Is data in each of these fields required?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Hm! First question is: do you expect data in the result set?

    I notice in the snapshot of the query grid that you have date comparisons. Date comparisons are often the culprit when getting an empty result set (or an unexpected result set). Here is a link to an explanation about Access dates - far better than I could ever write it.

    http://allenbrowne.com/ser-36.html

    In fact I would advise you to scan all of Allen's site, it's a cornucopia of information.

    Unfortunately we cannot see all of your design grid; try posting the SQL. The second comparison filters by surname. I would tend to write this as (use your own form and control names)

    Like Trim(Nz([forms]![form1]![text0],"")) & "*"

    I can't comment on the other comparisons as they are hidden.


    PS June, you got there first - again!
    Last edited by Rod; 11-19-2012 at 05:43 PM. Reason: Added PS

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

Similar Threads

  1. Replies: 3
    Last Post: 10-18-2012, 02:25 PM
  2. Replies: 13
    Last Post: 01-10-2012, 09:56 AM
  3. Merge 2 queries with null? values
    By PrintShopSup in forum Queries
    Replies: 2
    Last Post: 10-03-2011, 09:09 PM
  4. Replies: 1
    Last Post: 07-02-2010, 03:55 AM
  5. Replies: 1
    Last Post: 03-09-2006, 12:12 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