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!

Need help with running a query from form using combo

Status
Not open for further replies.

supermaestro

Programmer
Dec 18, 2002
15
GB
Hello

I've created a form called 'General Mailshots'. This form consists of a combo box called 'Transaction Types' and a datasheet query called 'generalMailshotQuery'. What i'd like to do is for the datasheet view to refresh/re-run using the user defined criteria in the combo box. A)How do I get the form to re-run the query when the user clicks the combo box and B)How do I set the criteria in the query to match that that the user puts in the combo box?

I've tried everything and any help would be appreciated
 
1) in the query, set the criteria for the field that matches the bound column of the combo box to

=Forms![General Mailshots]![Transaction Types]


2) in the After UPDATE event of the COMBO BOX, issue a requery of the datasheet control

Forms![General Mailshots]! { control name here }.FORM.REQUERY

I'm assuming that your datasheet is a subform? It's not clear.

If the datasheet is in the main form, just issue

Forms![General Mailshot].Requery

Get it?

Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top