Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with filtering a form by a combo box

Status
Not open for further replies.

mongous

Technical User
Jun 18, 2002
116
US
Hi all

I am trying to filter a form using a combo box value. The box contains userids and the idea is for a supervisor to be able to filter the records entered by the employees userid. I have the 'After Update' event property set to a macro which runs a query I built to pull by the value of the combo box.

The problem is when I change the selection in the box, I get this alert:
[blue]Enter Parameter Value
cboUserId.Value[/blue]

When I enter the value it does work, but I shouldn't have to do that step. What am I missing???

Any help greatly appreciated!
 
You query should use something like:
Forms![name of the form]!cboUserId
instead of:
cboUserId.Value

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Youre probably better off using the On Change event of the combo box.

Also is the macro running a query?
Im assuming the combo has no default value, so the form opens showing all records, if so you'll need to set the forms initial data source to an unfilter query then switch the data source when the combo has been changed.

"My God! It's full of stars...
 
How are ya mongous . . .

This is easily done with the [blue]Combobox Wizard[/blue]! . . . Have you tried it! . . .

Calvin.gif
See Ya! . . . . . .
 
Thank you all! All very helpful suggestions. I ended up using PHV's advice, and it worked beautifully! As far as the wizard, no i didn't realize! (but I had previously converted a textbox to the combo box which is why I didn't use the wizard)

Much thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top