Im trying to change the query filter for a listboix using an options group with 3 buttons. Here is my code:
The query is called ServReq Query. IM trying to show different status' with different options group buttons(IE btn 1 shows status' 1,2,3,4,9 -- btn 2 shows 5,6,7,8 -- btn 3 shows all)
How should my update statement be formatted?
Im getting 'Run-time error '3144'' Syntax error in UPDATE statement.
Code:
Private Sub optView_AfterUpdate()
Dim strUpDate As String
If Me.optView.Value = 1 Then
strUpDate = "UPDATE ServReq Query WHERE (((ServReq Query[Status]=1) OR ((ServReq Query[Status]=2) OR ((ServReq Query[Status]=3) OR ((ServReq Query[Status]=4) OR ((ServReq Query[Status]=9);"
ElseIf Me.optView.Value = 2 Then
strUpDate = "UPDATE ServReq Query WHERE (((ServReq Query[Status]=5) OR ((ServReq Query[Status]=6) OR ((ServReq Query[Status]=7) OR ((ServReq Query[Status]=8);"
Else
strUpDate = "UPDATE ServReq Query WHERE (((ServReq Query[Status]=1) OR ((ServReq Query[Status]=2) OR ((ServReq Query[Status]=3) OR ((ServReq Query[Status]=4) OR ((ServReq Query[Status]=5) OR ((ServReq Query[Status]=6) OR ((ServReq Query[Status]=7) OR ((ServReq Query[Status]=8) OR ((ServReq Query[Status]=9)));"
End If
CurrentDb.Execute strUpDate, dbFailOnError
End Sub
The query is called ServReq Query. IM trying to show different status' with different options group buttons(IE btn 1 shows status' 1,2,3,4,9 -- btn 2 shows 5,6,7,8 -- btn 3 shows all)
How should my update statement be formatted?
Im getting 'Run-time error '3144'' Syntax error in UPDATE statement.