maybe it's this headache - easy SQL question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I get this to insert into multiple fields, instead of just one.

strSQL = "Insert Into tblVendors ([Vendors]) " & _
"values ('" & nvendor & "');"

-Thanks!!!!!!!!
 
How do I get this to insert into multiple fields, instead of just one.

strSQL = "Insert Into tblVendors ([Vendors]) " & _
"values ('" & nvendor & "');"

-Thanks!!!!!!!!

Multiple fields in the same record? Multiple records in the table?

What's the context? Just what are you trying to accomplish?

John W. Vinson [MVP]
 
awrex said:
How do I get this to insert into multiple fields, instead of just one.

strSQL = "Insert Into tblVendors ([Vendors]) " & _
"values ('" & nvendor & "');"


If the second field is a numeric type:
strSQL = "Insert Into tblVendors (Vendors, field2) " & _
"values ('" & nvendor & "', " & value2 & ")"

If the second field is type Text:
strSQL = "Insert Into tblVendors (Vendors, field2) " & _
"values ('" & nvendor & "', '" & value2 & "')"
 
Thank you!!!!

To answer the other questions. This is for compiling all the data collected
on another form to be inserted into a table.

The example I used was a part of the first form for adding a vendor that may
not be listed on a list control.


Marshall Barton said:
awrex said:
How do I get this to insert into multiple fields, instead of just one.

strSQL = "Insert Into tblVendors ([Vendors]) " & _
"values ('" & nvendor & "');"


If the second field is a numeric type:
strSQL = "Insert Into tblVendors (Vendors, field2) " & _
"values ('" & nvendor & "', " & value2 & ")"

If the second field is type Text:
strSQL = "Insert Into tblVendors (Vendors, field2) " & _
"values ('" & nvendor & "', '" & value2 & "')"
 
Back
Top