Rerun a query on a form

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
Back
Top