running a concatenate query in a form

Payal Patel

Registered User.
Local time
Today, 08:28
Joined
Nov 3, 2009
Messages
34
Hi,
I have a form with a command button to execute 2 queries. Here is the code I have:
Private Sub Command7_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "Concat Query"
DoCmd.OpenQuery "Make Table Query"
DoCmd.SetWarnings True
MsgBox "Execution Complete"
End Sub

When I run this through the command button, instead of just running, it opens the tables. Is there a way where if I just press the comman button to execute, it doesn't take me to the tables.
Thanks,
 
make table queries are ACTION queries, they don't open by default, but SELECT queries do. you don't have a choice. the only ones that don't open and display data are the ACTION queries:

DELETE
APPEND
MAKE TABLE
etc,....
 
You can run DML and DDL using DoCmd.RunSQL. Is that what you're looking for?
 
If this one

DoCmd.OpenQuery "Concat Query"

is just concatenating fields and stuff and the make table uses that, you don't need to run the "Concat Query" separate. It will run as part of the make table query.
 
Thanks for the help. I got rid of the concat query and it worked fine.

thanks
P.;)
 

Users who are viewing this thread

Back
Top Bottom