I am trying to have my button call up multiple fields from the same table my code looks like this now and I am getting a type mismatch error. The button works just fine when I try to pull from only one field.
Private Sub Command26_Click()
On Error GoTo Err_Command26_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim stLinkCriteria2 As String
stDocName = "EmployeeAdd"
stLinkCriteria = "[EmpLast]=" & "'" & Me![EmpLast] & "'"
stLinkCriteria2 = "[OrgCode]=" & "'" & Me![Orgcode] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria And stLinkCriteria2
Exit_Command26_Click:
Exit Sub
Err_Command26_Click:
MsgBox Err.Description
Resume Exit_Command26_Click
End Sub
Thank You
Ryan
Private Sub Command26_Click()
On Error GoTo Err_Command26_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim stLinkCriteria2 As String
stDocName = "EmployeeAdd"
stLinkCriteria = "[EmpLast]=" & "'" & Me![EmpLast] & "'"
stLinkCriteria2 = "[OrgCode]=" & "'" & Me![Orgcode] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria And stLinkCriteria2
Exit_Command26_Click:
Exit Sub
Err_Command26_Click:
MsgBox Err.Description
Resume Exit_Command26_Click
End Sub
Thank You
Ryan