D
Duck
I am a VBA newbie so bear with me. I am trying to appent new records
to a table. Just to try to get the format of the statement right I am
trying the following test code:
Public Sub Update()
Dim strSql As String
Dim strVendor As String
Dim strModel As String
strVendor = "Bosh"
strModel = "M111"
strSql = "INSERT INTO tblInventory (Vendor, ModelNo)"
strSql = strSql & " SELECT '" & strVendor & "', '" & strModel &
"'"
DoCmd.RunSQL strSql
End Sub
When I type "Update()" in the immediate window expecting the code to
add a record to my tblInventory table I keep getting: Compile error:
Expected: =
What am I not understanding???
to a table. Just to try to get the format of the statement right I am
trying the following test code:
Public Sub Update()
Dim strSql As String
Dim strVendor As String
Dim strModel As String
strVendor = "Bosh"
strModel = "M111"
strSql = "INSERT INTO tblInventory (Vendor, ModelNo)"
strSql = strSql & " SELECT '" & strVendor & "', '" & strModel &
"'"
DoCmd.RunSQL strSql
End Sub
When I type "Update()" in the immediate window expecting the code to
add a record to my tblInventory table I keep getting: Compile error:
Expected: =
What am I not understanding???