I have a form that I placed a "link" to which is supposed to open one of three forms dependent on a value on the form. This is the sub:
Private Sub Label46_Click()
On Error GoTo Err_Label46_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim strFrmOpt As String
Dim strIDr As String
Select Case Me.Cl_Type
Case "Auto"
strFrmOpt = "Auto_Claim_frm" And strIDr = "Auto_adjID"
Case "GL"
strFrmOpt = "General_Liability_Claim_frm" And strIDr = "GL_adjID"
Case "WC"
strFrmOpt = "WC_Injury_Claim_frm" And strIDr = "WC_adjID"
End Select
stDocName = strFrmOpt
stLinkCriteria = strIDr & " ='" & Me![ClaimID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Label46_Click:
Exit Sub
Err_Label46_Click:
MsgBox Err.Description
Resume Exit_Label46_Click
End Sub
Problem is, on the form itself when I click the label a msg box appears that simply says "Type Mismatch", and I can't figure out why. All the values this sub is looking at are text values. Any suggestions?
Private Sub Label46_Click()
On Error GoTo Err_Label46_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim strFrmOpt As String
Dim strIDr As String
Select Case Me.Cl_Type
Case "Auto"
strFrmOpt = "Auto_Claim_frm" And strIDr = "Auto_adjID"
Case "GL"
strFrmOpt = "General_Liability_Claim_frm" And strIDr = "GL_adjID"
Case "WC"
strFrmOpt = "WC_Injury_Claim_frm" And strIDr = "WC_adjID"
End Select
stDocName = strFrmOpt
stLinkCriteria = strIDr & " ='" & Me![ClaimID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Label46_Click:
Exit Sub
Err_Label46_Click:
MsgBox Err.Description
Resume Exit_Label46_Click
End Sub
Problem is, on the form itself when I click the label a msg box appears that simply says "Type Mismatch", and I can't figure out why. All the values this sub is looking at are text values. Any suggestions?