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

stlinkcriteria for multiple values 1

Status
Not open for further replies.

dolodolo

Technical User
May 27, 2003
86
US
Hi,

I am getting a type mismatch error on the following code. My objective is to open a detail form from a header form passing two criteria through - LoginName & db. Any help appreciated.

Private Sub ViewDetail_Click()
On Error GoTo Err_ViewDetail_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frm_UserDetail"

stLinkCriteria = "[LoginName]=" & "'" & Me![LoginName] & "'" And "[DB]=" & "'" & Me![DB] & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_ViewDetail_Click:
Exit Sub

Err_ViewDetail_Click:
MsgBox Err.Description
Resume Exit_ViewDetail_Click

End Sub
 
Try:

Code:
stLinkCriteria = "[LoginName]='" & Me![LoginName] & "' And [DB]='" & Me![DB] & "'"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top