Hello Folks,
I’ve never done much with SQL and I’m trying to use a SQL string to append a record to a file from a button on a form. I have a user who is computer challenged so I can’t just use the add record button. Here’s the code I’ve cobbled together from doing an append query looking at the SQL and looking at some of the SQL posts on the board. I keep getting the attached message.
Dim iNewLotNo As Integer Dim zSqlStr As String On Error GoTo Err_cmdNewRecord_Click iNewLotNo = InputBox("Enter the New Storage Lot Number", "Add Storage Lot", 0) If iNewLotNo = 0 Then GoTo Exit_cmdNewRecord_Click Else 'SQL Code here zSqlStr = "INSERT INTO StorageLots ( [StorageLotNo], [OwnerID] )" & _ "WHERE ([StorageLotNo]=" & iNewLotNo & _ ", [StorageLots.OwnerID]=600);" DoCmd.RunSQL zSqlStr End If
So, I figure I’m missing a qoute or comma somewhere?
Thanks,
RG