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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Mismatch on Opening Form with Criteria? 1

Status
Not open for further replies.

firebirdta84

Technical User
Aug 23, 2007
56
US
I need to open a form and show only those records that meet two sets of criteria. I am currently getting a type mismatch when I try this. Here's the code:

On Error GoTo Err_cmdOpenFeedback_Click

Dim stDocName2 As String
Dim stLinkCriteria2 As String

stDocName2 = "frm_Feedback"

stLinkCriteria2 = "[Case_Number]=" & "'" & Me![Case_Number] & "'" And "[Inv_SID]=" & "'" & Me![Investigator] & "'"
DoCmd.OpenForm stDocName2, , , stLinkCriteria2
Me.Combo59.Value = Null

Exit_cmdOpenFeedback_Click:
Exit Sub

Err_cmdOpenFeedback_Click:
MsgBox Err.Description
Resume Exit_cmdOpenFeedback_Click


Any help would be appreciated!

Thanks,
Joe
 
If Case_Number or Inv_SID are dzfined as numeric then you don't need quote for the corresponding value.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Both Case_Number and Inv_SID are defined in the tables as Text.

Joe
 
Code:
stLinkCriteria2 = "[Case_Number]='" & Me![Case_Number] & "' And [Inv_SID]='" & Me![Investigator] & "'"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top