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

Having a problem with Maketable queries 1

Status
Not open for further replies.

melkober

Technical User
Jun 14, 2006
8
CA
When running query from the query menu, it is fine with creating the table when the table does not exist, but when I run it from a DoCmd.OpenQuery it always needs the table to exist. Is there a way around this?
 
A maketable query (SELECT ... INTO ... FROM ...) ALWAYS create a new table !

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Sorry, I am pretty new at this. Does that mean I should not use DoCmd?
 
What is wrong with DoCmd ?
What is the SQL code of your query ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
SELECT Solenoidmain.[Mount Configuration], Solenoidmain.Manufacture INTO Manufacture_fill
FROM Solenoidmain;
 
OK, it's a real MakeTable query.
Again, what is wrong with DoCmd.OpenQuery ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Well, this Maketable query is attached to a form that I have made. When I run the query independantly it will make a table that is not yet in existence (a table I have programmed it to make). But when the query is run from this form (using a DoCmd.OpenQuery statement) the table (whether blank or full) has to be in existence otherwise I get an "Error-This table does not exist" debugging statement. The reason I would like to make tables that do not exist instead of over-writing tables over and over again is because each time I do this there is a window that comes up asking if I would like to delete the existing table (to which the answer will always be yes).
 
there is a window that comes up asking
In VBA:
DoCmd.SetWarnings False
' your code here
DoCmd.SetWarnings True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
How 'bout

DoCmd.RunSQL (CurrentDb.QueryDefs("query name here").sql)



TMTOWDI - it's not just for Perl any more
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top