Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing Access Queries in Code

Status
Not open for further replies.

hirenJ

Programmer
Dec 17, 2001
72
GB

Hi all,

I have a process whereby 3 access queries are executed one after the other -- I have a progress bar meter pop-up that will run while the queries are being executed..

How can I execute these queries in code, with it all being transparent to the user? I know that I have to do setwarnings = false -- but is it possible to run access queries without having to view the data /design screens during execution?


thanks

Hj

:eek:)

 
You should be able to create a string containing your SQL statement and then execute a DoCmd.RunSQL or execute a DoCmd.OpenQuery if the query is already defined and you don't need to dynamically change the SQL.

There are other ways to do this but depending on what you are trying to do, these might be easiest.....

JJ J. Jones
jjones@cybrtyme.com
 
The Queries are made by the user -- therefore, they vary with each session -- is it possible to retrieve the underlying SQL statement from an access query at runtime?

I dont really want to use the docmd.openQuery statement, as then the queries will all pop-up on the screen -- and suck all the computer RAM ...

any ideas?

thanks guys

Hj

:eek:)
 
Do the users create the queries in design view or by entering data on a form (& then you creating the query for them)? J. Jones
jjones@cybrtyme.com
 
You should be able to do something like this:

Dim qryname As String

qryname = "qryMakeTable" (whatever your query name is)
DoCmd.OpenQuery qryname, acNormal, acEdit

Hope this helps...

JJ
J. Jones
jjones@cybrtyme.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top