Hi,
I am picking up a date from the form in VBA Code and trying to execute SQL Statement. I am getting "Run Time Error "3075". Syntax Error (missing operator) in query expression". Please find below the respective Code.
Kindly suggest.
I am picking up a date from the form in VBA Code and trying to execute SQL Statement. I am getting "Run Time Error "3075". Syntax Error (missing operator) in query expression". Please find below the respective Code.
Code:
Private Sub btnDeldt_Click()
Dim dt As Date
dt = Me.txtDelDt
Dim sql As String
sql = " Delete tblCompDB.ActualClosedDate WHERE (((tblCompDB.ActualClosedDate)>= #" & dt & "# "
DoCmd.RunSQL sql
sql = " Update tblCompDB.ComplaintStatus = 'Pending' WHERE (((tblCompDB.ActualClosedDate)>= #" & dt & "# "
DoCmd.RunSQL sql
End Sub
Kindly suggest.