Created a query.. How do i get a button to run it?

test123123help

Registered User.
Local time
Today, 08:46
Joined
Jan 30, 2004
Messages
20
Title says it all. How do i get this button on my form to run the query?
 
Try This


DoCmd.OpenQuery "queryname"


This command will be put on the On Click event of the Button on the form
 
Code:
Dim strOpenQuery As String
strOpenQuery = "qryQueryName"
DoCmd.OpenQuery strOpenQuery, acNormal, acEdit
________
Toyota Wish Specifications
 
Last edited:
The Access button wizard will do this for you.
 
One Thing To Remember!!!!!

If ya dont want a warning to appear that this will alter your data blah blah blah...then insert:

docmd.setwarnings false

before you call the query!

Regards,

DALIEN51
 
In Access 2010 when you add a button the wizard will open. then go to misc and Run Query. you can also show it as a report if you have made a report from your query you would use the Report Operations and Run Report this will show you your query as a report that you could print or email.
 
Great idea
on the button and chose from proparities - even onclick
and write the need code
 

Users who are viewing this thread

Back
Top Bottom