473,396 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to get a combo box for query criteria

18
Guys, I spend hours trying to solve this problem on my own but no progress. I am using a query and right now I have "Enter ID Number" in the criteria box. But, it is not possible to remember all the id's, so what I want is a combo box in the message box, that will still ask the user "Enter ID Number" but instead of having a blank box I will have a drop down list of all the id's so that I can scroll down and just pick my id instead of bothering to remember them. Please help.

Hulas
Mar 29 '08 #1
2 1557
JConsulting
603 Expert 512MB
Guys, I spend hours trying to solve this problem on my own but no progress. I am using a query and right now I have "Enter ID Number" in the criteria box. But, it is not possible to remember all the id's, so what I want is a combo box in the message box, that will still ask the user "Enter ID Number" but instead of having a blank box I will have a drop down list of all the id's so that I can scroll down and just pick my id instead of bothering to remember them. Please help.

Hulas
that's not possible. What you should do though, is put that on a form, and have your user select from the combo box then run the query. The criteria in the query would then change to forms!Yourform!YourCombo

As long as the bound field for the combo box contins the ID number, you're golden.

J
Mar 30 '08 #2
LeoK
8
what JConsulting said is true, it would just be easier to design a form, with the ID number as a combo box. You can add all the fields that relates to that ID number in the same form. If you do this in the Form wizard on Access 2003 the code for that ID combo is written for you, so that whenever you click on anything on the list the other fields relating to that combo box will automatically update.
The code should look something like this, located in the properties of the combo box in the "Event" tab and on the "After Update" row.

Private Sub List19_AfterUpdate()
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[EVENT_ID] = " & Str(Nz(Me![List19], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

I am designing a member type database and I do find that this kind of form is very good for finding/view/editing members information.
Mar 30 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: pelcovits | last post by:
I am trying to set up an unbound form to enter report criteria. I've followed the MS Office Assistance document: "Create a form to enter report criteria" which describes how to enter data (such...
1
by: BigJay | last post by:
I am 1. trying to have a combobox used as a selector to display records in a subform. and not sure on how to get selected info into subform.the combo is populated but can not get subform updated...
4
by: meganrobertson22 | last post by:
Hi Everyone- I have a question about how to add and then use the "All" selection in a combo box. I am trying to figure out how to: (1) add "All" as a selection to a combo box and then (2)...
3
by: Stewart | last post by:
Hi all! My (relatively small) database holds data on staff members and the projects (services) that they are assigned to. In my form frmStaff, I have a list of staff members - it is a...
3
by: hmiller | last post by:
Hey everyone, I am having a hell of a time trying to set this menu system up. Here's what I'm trying to do. Combo Box One; is populated by names under properties "row source" "Phase 1"...
2
by: visionstate | last post by:
Hi there, I am working on a form that uses 3 text boxes and 3 combo boxes. When any data is entered into any of these, I click a command button and this requeries a sub query in the form and...
3
by: ericargent | last post by:
Hi I'm using Acces 2003 I have Query where the several parameters for the criteria are supplied from a form. One parameter source is a combo box. What I am trying to do is if: An item is...
4
by: Swinky | last post by:
I am trying to make a combo box dependent on a text box. I cannot get the combo box to pull the related data from the text box. I have been all over this user group & have tried several versions...
4
by: torontolancer | last post by:
Hi there how r u .I would really appriciate ur concern regarding checking out this code. its beind a command button and i am have a combo box selecing a query criteria and then pressing the button...
2
by: franc sutherland | last post by:
Hi, I am using Access 2003. I am having a problem with a pair of combo boxes. I want the second one (cbo_service) to have it's row source limited by the value I select in the first one...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.