Results 1 to 4 of 4
  1. #1
    brezja is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    5

    Unbound Combo Box Query Parameter

    I am putting the finishing touches on a database and I'm running into one last issue. I have a main table, a query for that table, an input form...and a search form that when run, populates the query based on any combination of values from unbound text boxes or unbound check boxes, mainly using the Like "*" & [Forms]![SearchForm]![Field] & "*" Or Is Null expression.



    I do have a few unbound combo boxes in that form, as there are a few fields where I wanted to limit the input choices that I would like to be able to search with. My issue is that I am trying to come up with a Parameter Criteria, akin to the one above, to be able to bring up the value that I would choose in the combo box...but to overlook it if the field is left blank. Any ideas?

    What happens is...if I use the Like "*" & [Forms]![SearchForm]![Field] & "*" Or Is Null it brings up everything and doesn't filter down to just someone in say...team 1. If I use the [Forms]![SearchForm]!Field it brings up no records except for the one that I search for...and some fields have null values because not everyone is on one of those teams. Should I cut my losses and just use an unbound text box instead?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    The LIKE and wildcard parameter should work with combobox reference.

    But why do you show Field in your example? This should be name of control.
    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
    brezja is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2014
    Posts
    5
    I just did it for the sake of example.......the real string reads:

    Like "*" & [Forms]![frmSearchAllCampus]![sERT_Team] & "*" Or Is Null

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Don't know why not working for you, combobox works for me.

    What is the value of the field this parameter is applied to? Do you have lookup set in table for this field?

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

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

Similar Threads

  1. #Name? Error in Unbound Combo Box
    By johnlight in forum Access
    Replies: 9
    Last Post: 10-23-2013, 11:30 AM
  2. Default value on an unbound combo box
    By lsmcal1984 in forum Forms
    Replies: 1
    Last Post: 10-10-2013, 06:40 AM
  3. Replies: 4
    Last Post: 09-09-2013, 05:34 AM
  4. Replies: 3
    Last Post: 10-07-2011, 07:49 AM
  5. Add combo box to parameter query
    By louisa14 in forum Queries
    Replies: 1
    Last Post: 12-10-2005, 08:38 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