Created a query.. How do i get a button to run it? (1 Viewer)

test123123help

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

theprez

Registered User.
Local time
Today, 04:38
Joined
Nov 8, 2001
Messages
140
Try This


DoCmd.OpenQuery "queryname"


This command will be put on the On Click event of the Button on the form
 

a.sinatra

quik
Local time
Yesterday, 20:38
Joined
Jan 10, 2004
Messages
262
Code:
Dim strOpenQuery As String
strOpenQuery = "qryQueryName"
DoCmd.OpenQuery strOpenQuery, acNormal, acEdit
________
Toyota Wish Specifications
 
Last edited:

neileg

AWF VIP
Local time
Today, 04:38
Joined
Dec 4, 2002
Messages
5,975
The Access button wizard will do this for you.
 

DALIEN51

Registered User.
Local time
Today, 04:38
Joined
Feb 26, 2004
Messages
77
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
 

RaWiKe

New member
Local time
Yesterday, 20:38
Joined
Sep 26, 2013
Messages
4
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.
 

salgergawi

Registered User.
Local time
Today, 06:38
Joined
Sep 28, 2013
Messages
23
Great idea
on the button and chose from proparities - even onclick
and write the need code
 

Users who are viewing this thread

Top Bottom