I want to delete certain records based on the selected date .
However, I come across with this is error - Run time error '3464' (Data type mismatch in criteria expression)
This part is highlighted in yellow. I even used the debug.print to test out if the sql statement is executed properly.
However, It seems that there's no problem.
Code:
DoCmd.RunSQL DelSummarySQL
Here is my full code
Code:
Private Sub cmd_Delete_Click()
Dim DelSummarySQL As String
Dim StartRange As Date
StartRange = CDate(cboStartRange)
DelSummarySQL = "Delete * FROM Summary WHERE Record_Period = '" & StartRange & "' "
Debug.Print DelSummarySQL
DoCmd.RunSQL DelSummarySQL
'cmd_Cancel_Click
End Sub
Any ideas where went wrong ?
Thanks in advance