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

Commands and a reluctant MakeTable filter 2

Status
Not open for further replies.

kupe

Technical User
Sep 23, 2002
376
I tried to get a command button to action a MakeTable query, but it wouldn't. So I offered the task to a macro, and attached that to the DoCmd, but that won't do it either. Is there something about MakeTable queries I should know please?
 
Hi kupe,

It ought to work; there's no special requirement I know. The wizard should set it up properly. How did you try and do it?

Enjoy,
Tony
 

Macro example

Set warnings Off
OpenQuery
SetWarnings on

Drawbacks
by turning of the warnings you will not
be informed of the previous table (if it exists )
being deleted.

if create errors ie no records or relationship issues
occur you wont know and nothing will happen


CodeExample

docmd.setwarnings false
DoCmd.OpenQuery , "qrynme2"' note this will only work for
' action queries

docmd.setwarnings true

the advantage here is that you can put your own error trapping in.

Regards

Jo
 
Hi Jo and Tony

I tried again by using the Wizard's code, but it still won't work. Does seem really odd. The query does its stuff each time, but give it a macro or cmd button, and it isn't interested. Perhaps then a MakeTable query is not an 'action query' and can't work this way. Thanks for your help. Cheers
 
Hi kupe,

Thanks for the star but I'm not sure how I've helped you. Just checked it out (in A2000) and it all works fine for me. Does your table already exist? Do you have warnings suppressed? If the answer to both is yes it might appear that nothing was happening because the default is not to delete an existing table.

Enjoy,
Tony
 
Hi Tony

No, all the usual things are in place. There seemed no reason why it should be so. Of course, I made the table and deleted it a dozen times with the query, but whether the table exists or not, the code isn't interested in actioning the query.

However, if this isn't the norm, then you have helped. I had thought that was the end of coding a MakeTable query into action. When I have a bit more time, I'll try it in another database. (Sometimes when weird things happen in a database, the only answer seems to be to import the features into a new database.) Perhaps I'll try that later. I appreciate your concern very much. Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top