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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA -DoCmd .RunMacro

Status
Not open for further replies.

daveblay

Technical User
Oct 24, 2002
1
GB
Hi
I have a database that includes a module to check if tables have been updated and if not run a macro that opens 2 queries one to creates a table and one to append to a table.I have used the code before succesfully before but not including action queries .
The Macro gets as far as opening the query then I get "action failed " runtime error 3069 ,
help says "To run an action query, use the Execute method instead of the name of an action query as input to the FROM clause."

I have very limited knowledge of VBA ,is there a short bit of code to over come this problem.

any comments would be welcome

Thanks
Dave b
 
Will your queries run manually? If so, try to run your macro from the macro window, instead of calling it in code. If it runs, then something is wrong with your code. If it doesn't, you've got a problem with the queries or the macro.

I'm guessing your macro won't run, even from the macro tab - probably due to something being messed up in your queries.

You might post the code you're using to call the macro, as well as what actions you're using in the macro itself.

 
Instead of the Macro calling the queries, why not just call the queries in succession in your code????

An action query "opened" from code merely executes it...

DoCmd.OpenQuery "Query1"
DoCmd.OpenQuery "Query2"
etc...



****************************
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III
MCSA, CNA, MCP, Network+, A+
w: robert.l.johnson.iii@citigroup.com
h: wildmage@tampabay.rr.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top