In the code below, I'm receiving a Run-time error '3141': The SELECT statement includes a reserved word or an argument name this is misspelled or missing, or the punctuation is incorrect.
The line causing the error is: Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot), but as best as I can tell, my SQL statement is correct.
Can someone kindly tell me what is causing the error? Thanks in advance for any assistance.
Private Sub PhaseDeliverableName_BeforeUpdate(Cancel As Integer)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strResult As String
Dim strSQL As String
Set db = CurrentDb
strSQL = "SELECT LookupPhaseDeliverable.PhaseDeliverableSequence AS SeqNum" & _
"FROM LookupPhaseDeliverable " & _
"WHERE (((LookupPhaseDeliverable.PhaseDeliverableName)=" & Me.PhaseDeliverableName & ";"
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)
strResult = rs("SeqNum")
rs.Close
End Sub