Clear parameter query form without a command button


G

GD

I am using text boxes on a form as query parameters. How do I get the text
boxes to reset (or return to blank) after the query is run. Can someone give
me an example of the code I need?
 
Ad

Advertisements

J

Jeff Boyce

I think I'm missing something...

If you are using a form to collect parameters for a query, how does the
query know to run?

If you are using a command button to run the query, then add the code that
empties the parameter controls to the command button's Click event procedure
after the code that runs the query.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
G

GD

Can you give me an example of how that code should read? Here's how it reads
so far:

Private Sub Command62_Click()
DoCmd.OpenQuery "qryLast2months", acViewNormal, acEdit
End Sub
 
J

Jeff Boyce

An example:


GD said:
Can you give me an example of how that code should read? Here's how it
reads
so far:

Private Sub Command62_Click()
DoCmd.OpenQuery "qryLast2months", acViewNormal, acEdit
Me!txtYourFirstTextBox = Null
Me!txtYourSecondTextBox = Null
...
Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Ad

Advertisements

G

GD

Works great!! Thanks, Jeff!
--
GD


Jeff Boyce said:
An example:




Me!txtYourFirstTextBox = Null
Me!txtYourSecondTextBox = Null
...


Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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