Parameterized query for a form, using a control's contents

J

Jeff Evans

I have a dropdown list that is to be populated with a parameterized query.
The parameter for the query comes from a textbox on the form, say paramBox.
I know how you have to refer to the value in the query:
[FORMS!formName!paramBox], but I can't get it to work the way I intended.
Ideally the user should type a number in the box, and then the dropdown list
should be populated based on that. Do I need to code something in an event
for the textbox (textchanged or something), or do I need a command button
the user clicks once they enter the number? Furthermore, how do I tell the
dropdown list to get its results from this query... it doesn't seem to have
anything to do with setting its properties at design time.

Thanks for any tips.
 
D

Dave

That's it: you need to requery the combo box after the text box has been
updated. Assuming the query for the combo box refers correctly to the text
box, put this in the AfterUpdate event procedure:

cboDropdown.Requery

modified for whatever your combo box is named.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top