Hi,
Thanks for your help in advance, its really appreciated.
I am using ADO with SQL in Access VBA,
I want to essentially devise a form whereby I can enter using the SQL insert statement more than one record of data through the same form.
strSQL = "INSERT INTO tblContacts(" & _
"txtLastName, txtFirstName, txtTitle) " & _
"VALUES (" & _
"'" & Me.txtLastName & "', " & _
"'" & Me.txtFirstName & "', " & _
"'" & Me.txtTitle & "');"
"INSERT INTO tblContacts(" & _
"txtLastName, txtFirstName, txtTitle) " & _
"VALUES (" & _
"'" & Me.LN & "', " & _
"'" & Me.FN & "', " & _
"'" & Me.ttl & "'); "
When I run this I get an error saying extra text after end of line, refereing i think to the second insert command -
is it not possible to run more than one insert cmd per go? I thought this was not the case.
The end result would be to auto build a string of SQL to populate a number of tables.
Thanks for the help or any good online references to ADO SQL etc would be great.
Many Thanks,
Oliver
Thanks for your help in advance, its really appreciated.
I am using ADO with SQL in Access VBA,
I want to essentially devise a form whereby I can enter using the SQL insert statement more than one record of data through the same form.
strSQL = "INSERT INTO tblContacts(" & _
"txtLastName, txtFirstName, txtTitle) " & _
"VALUES (" & _
"'" & Me.txtLastName & "', " & _
"'" & Me.txtFirstName & "', " & _
"'" & Me.txtTitle & "');"
"INSERT INTO tblContacts(" & _
"txtLastName, txtFirstName, txtTitle) " & _
"VALUES (" & _
"'" & Me.LN & "', " & _
"'" & Me.FN & "', " & _
"'" & Me.ttl & "'); "
When I run this I get an error saying extra text after end of line, refereing i think to the second insert command -
is it not possible to run more than one insert cmd per go? I thought this was not the case.
The end result would be to auto build a string of SQL to populate a number of tables.
Thanks for the help or any good online references to ADO SQL etc would be great.
Many Thanks,
Oliver