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

Need to insert multiple values from form to table on button click synt 1

Status
Not open for further replies.

Phideaux

Technical User
May 1, 2003
51
US
I'm using this line of code initiated by a button click to move information displayed on a form to a table to initiate a work order.

DoCmd.RunSQL "Insert Into WorkOrders(MaintCntl)Values('" & Me!MaintCntl & "')"

This works well but i'd like to improve my operation and also insert predefined values (the number 2 into one field and a note into another field) these are in the same table as the first information (Value) i'm already inserting. the note and the number 2 are not going to change. I'm not having much success figuring out the syntax. Any help with the syntax would be great!
Thanks Phideaux



The mind is the best toy.
Play with someone else's often
 
Hi Phideaux,

Just add the extra columns and values to the field list and value list respectively ..

Code:
DoCmd.RunSQL "Insert Into WorkOrders(MaintCntl, ColumnTwo, ColumnNote) Values('" & Me!MaintCntl & "', 2 , 'Your note text' )"

Enjoy,
Tony
 
Thanks, this is Exactally what I needed! I tried it and it worked as planned again, Thanks!

Phideaux

The mind is the best toy.
Play with someone else's often
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top