i wan to open a report from my form...when i click the button to open the report...it gave me a error "Data type mismatch in criteria expression"...whats wrong?...can someone help?...
my code
Private Sub Command12_Click()
On Error GoTo Err_Command12_Click
DoCmd.OpenReport "incident", acViewPreview, , "[ID]='" & Forms![ret]!txtID & "'"
Exit_Command12_Click:
Exit Sub
Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click
End Sub
my code
Private Sub Command12_Click()
On Error GoTo Err_Command12_Click
DoCmd.OpenReport "incident", acViewPreview, , "[ID]='" & Forms![ret]!txtID & "'"
Exit_Command12_Click:
Exit Sub
Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click
End Sub