Here is the code I am using with the offending line underlined in bold. If this line fails I don't see why the first if statement doesn't also fail?
If anyone can help I would very much appreciate it.
Thanks
Client_Ref is the primary key
ViewReferral and ViewGen are yes/no boxes.
Expand|Select|Wrap|Line Numbers
- Private Sub Client_Ref_DblClick(Cancel As Integer)
- Me.Refresh
- If Me.ViewReferral = False And Me.ViewGen = True Then
- DoCmd.OpenForm "Gen_Users"
- DoCmd.ApplyFilter , "Client_Ref =" & Me.Client_Ref
- DoCmd.Close acForm, "ClientEntry"
- End If
- If Me.ViewGen = False And Me.ViewReferral = True Then
- DoCmd.OpenForm "Client"
- DoCmd.ApplyFilter , "Client_Ref =" & Me.Client_Ref
- DoCmd.Close acForm, "ClientEntry"
- End If
- If Me.ViewGen = True And Me.ViewReferral = True Then
- IRespond = MsgBox("Do you wish to view this customers referral information? (Selecting no will allow you to view their general user information", vbYesNo, "What would you like to see?")
- If IRespond = vbYes Then
- DoCmd.OpenForm "Client"
- DoCmd.ApplyFilter , "Client_Ref =" & Me.Client_Ref
- DoCmd.Close acForm, "ClientEntry"
- ElseIf IRespond = vbNo Then
- DoCmd.OpenForm "Gen_Users"
- DoCmd.ApplyFilter , "Client_Ref =" & Me.Client_Ref
- DoCmd.Close acForm, "ClientEntry"
- End If
- End If
- End Sub