Creating a clear/refresh Button (1 Viewer)

Breanna

Registered User.
Local time
Yesterday, 23:22
Joined
Dec 29, 2014
Messages
49
Using Access 2013.

I have a Search Form with a Run Query button. I would like to add a button that clears the criteria entered into the search text boxes. Right now to change the criteria I have to manually delete everything entered, closed the current query it had open then go from there. I have tried using the command button wizard, form operations, then refresh form data. When I click that button a window pops up "The command or action 'refresh' isnt available right now"

Is this not the correct way to set up what I need? What other options should I look into for setting this up?

Thanks.
 

essaytee

Need a good one-liner.
Local time
Today, 16:22
Joined
Oct 20, 2008
Messages
512
Using Access 2013.

I have a Search Form with a Run Query button. I would like to add a button that clears the criteria entered into the search text boxes. Right now to change the criteria I have to manually delete everything entered, closed the current query it had open then go from there. I have tried using the command button wizard, form operations, then refresh form data. When I click that button a window pops up "The command or action 'refresh' isnt available right now"

Is this not the correct way to set up what I need? What other options should I look into for setting this up?

Thanks.


Something along these lines within the Click event of a button.


Code:
'close current query
DoCmd.Close acQuery, "YourQueryName"

Me.YourSearchText1 = ""
Me.YourSearchText2 = ""
'and so on

' re-run your query or NOT, you probably want to manually enter new search criteria
'DoCmd.OpenQuery "YourQueryName"
 

Users who are viewing this thread

Top Bottom