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!

Runing SQL stored in a variable

Status
Not open for further replies.

bravid98

Programmer
Jun 6, 2001
7
US
I've got a form that generates multiple insert sql statements to go along with a multi select box. I've got the code working right and outputing correct sql into a variable. Here is a sample of the output, sorry if it's a little messy:

INSERT INTO tb_test Values (103,15080,7/11/2001,0.3333333,0.0833333,653,9.25,7/11/2001 9:23:27 PM,1,3,1,1);INSERT INTO tb_test Values (103,18189,7/11/2001,0.3333333,0.0833333,653,9.25,7/11/2001 9:23:27 PM,1,3,1,1);

I need to be able to actually run these queries and insert the data into a table. Any ideas?
 

How about using the RunSQL method of DoCmd?

DoCmd.RunSQL(SQLString)

Where SQLString is the variable that contains the insert statement. Terry Broadbent
Please review faq183-874.

"The greatest obstacle to discovery is not ignorance -- it is the illusion of knowledge." - Daniel J Boorstin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top