Drop down box in a form to call a query

danjwalker

New member
Local time
Today, 19:43
Joined
Mar 14, 2013
Messages
3
Hi,
I am sure you guys and girls know exactly how to do this, but I am stuck.

I want to track which user has which phone and track issues with them.

I have all the relationships set up right.

I have tables:

DeviceStatus - for the drop down box, contains IT Stock, Faulty, With User and Retired
DeviceTypes - Contains model numbers for devices
Assets - Contains a link to DeviceTypes, a link to DeviceStatus and the serial number of a phone.

I have a query:

StockStatus - shows Assets.ID, DeviceStatus.Status, DeviceTypes.description and Assets.SerialNumber

What I want as an end result is a form with a drop down box that shows DeviceStatus.Status (which I have working at the moment) with a go button next to it which will call the query that only shows what was selected in that drop down box.

Any help is highly appreciated.

Thanks
 
I wouldn't open a query for the user (forms and reports only), but if you want to you can add a criteria in the query that refers to the combo. I'd open a form for the user and use this method:

http://www.baldyweb.com/wherecondition.htm
 
Hi,

That did send me in the right direction, but I do not understand how to reference the combo box.

I use this:

doCmd.OpenForm "stockcheck2", , , "devicestatus = '" & Me.Combo7 & "'"

devicestatus is a column in stockcheck2 when viewing the data as a table
 
That's fine for referencing the combo, if the desired value is in the bound column. Do you get an error with that?
 
In the combobox, the text of "IT Stock" is selected. If I do:
msgbox me.combo7
I get a value of 1, but I want it to say IT Stock
 
Normally you would use the ID, but try

Me.combo7.Column(1)
 

Users who are viewing this thread

Back
Top Bottom