Run three Queries in VBA consecutively...

E

excel/access-chump

I am trying to run these 3 queries at the open of this form. I know they all
work independently of eachother as plain old queries. Can anyone interpret
my error and give me some direction in this matter? In all the help files I
can't seem to find the syntax explaination to allow me to input the proper
"Query Name argument"

"InvenTrackerTest" = Pass Through query to sql server
"InvenTrackerMakeTable" = Obvious
"InvenTrackerUpdate" = Trims()

-----------Error Message------------
"Run-time error '2406': The action or method requires a Query Name argument."

---------CODE----------
Private Sub Form_Open(Cancel As Integer)

DoCmd.OpenQuery (InvenTrackerTest)
DoCmd.OpenQuery (InvenTrackerMakeTable)
DoCmd.RunSQL (InvenTrackerUpdate)

End Sub
---------CODE----------
 
T

Tony Toews [MVP]

excel/access-chump said:
I needed to put quotes " " around the Query name.

<smile> Glad we could help.

On a more serious note it's amazing how often I solve a problem when I
compose the problem in a posting and then "aha" the solution hits me.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

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