Results 1 to 3 of 3
  1. #1
    Rosier75 is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    18

    NZ Function in Access Query

    Hello All,

    Here's my question/issue. I have a form with 10 unbound text fields. Users will enter data into any combination of the fields to search the database and return the results. I created 1 query and under the criteria section for each appropriate field, I used:

    Like NZ([Forms]![FormName]![TextFieldName],"*")

    This seems to work properly however, when I compare the data the query is pulling versus what is actually in the table, I am coming up a few records short. Example, query pulls 96 records when searching by a specific field but there are actually 98 records. Additionally, when I do my comparison, I am actually using a 2nd query that prompts me to enter the specific data I am entering on the form. I believe the issue is with how I'm using the NZ formula.

    Can anyone shed any light on this?

    Thanks

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    You may get some ideas from this free video tutorial. It's worth watching...
    http://www.datapigtechnologies.com/f...earchform.html


    Info on NZ https://www.accessforums.net/queries...ery-18462.html

  3. #3
    Rosier75 is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    18
    Problem solved. My data table contained empty values in the various search fields which seems to throw off the NZ Function. Entered "n/a" for my empty values and query run as expected.

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

Similar Threads

  1. Replies: 0
    Last Post: 06-03-2011, 09:03 AM
  2. Using SQL switch function MS Access
    By sandlucky in forum Queries
    Replies: 18
    Last Post: 03-31-2011, 08:49 AM
  3. Access Form If Function
    By cs93 in forum Forms
    Replies: 1
    Last Post: 03-23-2011, 02:33 PM
  4. Help with Access - IIf Function
    By cs93 in forum Programming
    Replies: 7
    Last Post: 03-19-2011, 11:52 AM
  5. Access SQL Query - Aggregate function
    By jack in forum Access
    Replies: 0
    Last Post: 11-10-2009, 08:06 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