I have this code below to print current record but getting this error "Data Type mismatch in Criteria Expression"
I checked all type and seems to be okay.
OhipNumber is a Primary key on tblPatient
type: Text, input mask of 0000000000;;
Fieldsize: is 10 all Numbers
Private Sub cmdRptPrint_Click()
On Error GoTo Err_cmdRptPrint_Click
Dim stWhere As String
Dim stDocName As String
stDocName = "rptPatient"
stWhere = "[OhipNumber]=" & Me!OhipNumber
DoCmd.OpenReport stDocName, acNormal, , stWhere
Exit_cmdRptPrint_Click:
Exit Sub
Err_cmdRptPrint_Click:
MsgBox Err.Description
Resume Exit_cmdRptPrint_Click
End Sub
I checked all type and seems to be okay.
OhipNumber is a Primary key on tblPatient
type: Text, input mask of 0000000000;;
Fieldsize: is 10 all Numbers
Private Sub cmdRptPrint_Click()
On Error GoTo Err_cmdRptPrint_Click
Dim stWhere As String
Dim stDocName As String
stDocName = "rptPatient"
stWhere = "[OhipNumber]=" & Me!OhipNumber
DoCmd.OpenReport stDocName, acNormal, , stWhere
Exit_cmdRptPrint_Click:
Exit Sub
Err_cmdRptPrint_Click:
MsgBox Err.Description
Resume Exit_cmdRptPrint_Click
End Sub