Results 1 to 9 of 9
  1. #1
    yawalias is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    2

    Using combo box for query value

    Hi,



    I would like to make a form that has a combo box to select a value from to run a query. I would like to use the selected value in the combo box in a query to find a specific item in the database. I would like the query to run when the run query button is selected. So far I have not had any luck. I have tried setting criteria in the query, but it does not work, etc. I have been reading various articles, but I can't figure out how to get the selected combo value into the query.

    Thanks!

  2. #2
    jbarrum is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Apr 2009
    Location
    Houston, Tx
    Posts
    164
    combo boxes are built on forms, not inside of a query. Combo boxes allow a user to select a valaue from a drop down that will display all data that pertain to that record. Is that what you are trying to do?

  3. #3
    MAF4Fam6's Avatar
    MAF4Fam6 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Location
    Fruit Heights, Utah USA
    Posts
    140

    Post

    Try the following in your query's criteria:
    Code:
    Like [Forms]![frmDoSearch]![Combo0]
    Replace frmDoSearch with your form's name.
    Replace Combo0 with the name of your Combo box, found in your Combo Box's property sheet...in the Other Tab.

    -RC

  4. #4
    jbarrum is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Apr 2009
    Location
    Houston, Tx
    Posts
    164
    RC,

    that is interesting. I did not know that you could do that? Thanks for sharing.

  5. #5
    MAF4Fam6's Avatar
    MAF4Fam6 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Location
    Fruit Heights, Utah USA
    Posts
    140

    Post Performing Searches Thru Queries From Combo Box in Form

    No problem.
    You can also use wild characters to broaden your search from your Combo Box's value.
    Here is an example:
    Code:
    Like "*" & [Forms]![frmDoSearch]![Combo0] & "*"
    -RC

  6. #6
    jbarrum is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Apr 2009
    Location
    Houston, Tx
    Posts
    164
    This is why I like this site. thanks for sharing

  7. #7
    BlueIshDan is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    8
    This should generate a form for you to go by
    https://www.accessforums.net/code-re...orm-44282.html

  8. #8
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    why are you cross posting your thread to everything else on the message board? even when the question has nothing to do with your application?

  9. #9
    BlueIshDan is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    8
    I thought that the code within the form could educate yawalias on how to put combo box values into his query.
    I also didn't post that thread across all threads on the message board, only on the ones that could use it to help them solve their problems.
    I'm sorry if my actions have aggravated you. Just trying to help.

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

Similar Threads

  1. Using Cascading Combo Boxes to Filter a Query
    By skiptotheend in forum Queries
    Replies: 0
    Last Post: 10-13-2009, 06:57 AM
  2. Combo box query
    By P5C768 in forum Queries
    Replies: 7
    Last Post: 09-18-2009, 05:51 AM
  3. Open a form using a query that references a combo
    By accessbobp646 in forum Access
    Replies: 1
    Last Post: 02-22-2009, 09:50 AM
  4. How to create a query for logical combo??
    By valkyry in forum Queries
    Replies: 1
    Last Post: 10-08-2007, 02:32 PM
  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