Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Type Mismatch in Criteria Expression

Status
Not open for further replies.

nmapeso

Technical User
Aug 26, 2005
28
0
0
US
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
 
[tt]stWhere = "[OhipNumber]='" & Me!OhipNumber & "'"[/tt]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks a lot PHV
I wont fine now, your the man....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top