By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,504 Members | 1,212 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,504 IT Pros & Developers. It's quick & easy.

how to run Insert Query behalf of Form

P: n/a
dear sir can any one give example how to run insert query...

where the results will come from select query

what i did on click button event

docmd.openquery ("query1")

thks
shahzad
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
INSERT INTO
MyTABLE (field1, field2, field3)
(SELECT
OtherField1 as field1,
Otherfield2 as field2,
OtherField3 as Field3
FROM MyOtherTable
WHERE bla bla
ORDER BY bla bla
);

and yes docmd.OpenQuery("MyQuery").

PS: the <<Otherfield as field>> is only for order pruposes, you can also
specify the fields with his own names, the only requirement is the order
must be the same in both tables.

Good Luck

Giorgio Gentili
(Chile)
"MUHAMAMD SALIM SHAHZAD" <ms******@yahoo.ca> escribió en el mensaje
news:5a**************************@posting.google.c om...
dear sir can any one give example how to run insert query...

where the results will come from select query

what i did on click button event

docmd.openquery ("query1")

thks
shahzad

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.