Rerun a query on a form

G

Guest

I have created a parrameter query which i have to type in a keyword to get
results based on the word, i run the query to a form.....my question is
this....is it possible to create a command button that will rerun this query,
what i have done for the moment is create a command button with the code
docmd.close acform,me.name
docmd.openform "formname"
This works fine but i was wondering if there was an easier way to do it
instead of close and opening the same form. I think that made sense.
Thank You In Advance.
 
K

kingston via AccessMonster.com

Will this work for you?

Put a textbox in the form and use that as the parameter for the query. Then
use the textbox's AfterUpdate event to requery the form.

Query criteria: [Forms]![MyFormName]![NewTextBox]
or Like "*" & [Forms]![MyFormName]![NewTextBox] & "*"

Set the textbox's AfterUpdate event to run a procedure: Me.Requery
 

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