Results 1 to 4 of 4
  1. #1
    royalrochelle is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    13

    Question View all data for blank parameter entry

    I am working on a survey database and the client wants scholars to take 6 different surveys within 6 different weeks. The client wants to be able to select a scholar (ex. Mary Smith) and a survey (ex. Week 1) and view the results in a report. The client also wants an option to view all scholars and/or all surveys in the report. It works fine when I put the following in the criteria for scholars:

    [Enter Scholar Name] or Like [Enter Scholar Name] Is Null
    I also put the following in the criteria for the survey field:
    [Enter Survey] or Like [Enter Survey] Is Null

    When I run the query it does exactly what I want to do. I run into problems when I try to use combo boxes from a form to get the values for the parameters in the query. I have 2 combo boxes named cxScholar and cxSurvey and I change the criteria in the query to the following:
    For the scholar field I type:
    [Forms]![fMakeSelection]![cxScholar] or Like [Forms]![fMakeSelection]![cxScholar] is Null

    For the survey field I type:


    [Forms]![fMakeSelection]![cxSurvey] or Like [Forms]![fMakeSelection]![cxSurvey] is Null
    When I get the values from the combo boxes on the form and then run the query, I always get this error message:
    “This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables. “

    I noticed it works fine using the form with just one parameter in the query but I get the error message with more than one parameter in the query. I had no idea how to do this and I learned a lot through research. I would like to know what I am doing wrong and is there a solution to this. Thank you so much in advance for your help.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    try using

    Like "*" & [Forms]![fMakeSelection]![cxScholar] & "*"

    and

    Like "*" & [Forms]![fMakeSelection]![cxSurvey] & "*"

  3. #3
    royalrochelle is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    13
    Edited this post
    Last edited by royalrochelle; 09-07-2011 at 08:00 PM. Reason: to reply to responder

  4. #4
    royalrochelle is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    13
    Thank you so much!! That worked perfectly! I should have posted this problem up here a long time ago.

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

Similar Threads

  1. Replies: 1
    Last Post: 08-02-2011, 07:21 AM
  2. Form view blank
    By reidn in forum Forms
    Replies: 1
    Last Post: 06-24-2011, 11:26 AM
  3. Display all results if parameter is blank
    By justifiedcandy in forum Queries
    Replies: 2
    Last Post: 09-02-2010, 03:00 PM
  4. Adding field to form causes blank view.
    By emccalment in forum Access
    Replies: 1
    Last Post: 04-02-2010, 06:27 PM
  5. blank on entry on add a record form
    By gmee in forum Forms
    Replies: 1
    Last Post: 10-07-2009, 07:31 AM

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