validation code (1 Viewer)

soundsfishy

Registered User.
Local time
Today, 18:16
Joined
Sep 25, 2002
Messages
174
what I want to is check to see if the Client number on the current form from tblClients matches the same number in another table. If the number doesnt exist in tblproposerMPMS , I wanted to let the user know that a referral cannot be generated until the client number has been entered.

Is there any way I can check to see if the client number in tblclients exist in tblproposerMPMS. If It doesnt I want a message informing the user that client number must completed in tblproposerMPMS to avoid a blank report from appearing.

Private Sub grpPrint_Click()
Dim strNumber

Select Case Me!grpPrint
Case 1
strNumber = DLookup("[MPMS]", "tblproposerMPMS", "[MPMS]='" & Me.MPMSNO & "'")
MsgBox " You must add MPMS & strNumber & to a Proposer inorder to generate a referral", vbOK
Else
DoCmd.OpenReport "rptwordProposerSupport", acViewPreview, , "[DIMAID] = " & Me.DIMAID

etc......

end select
EndSub
 

FoFa

Registered User.
Local time
Today, 03:16
Joined
Jan 29, 2003
Messages
3,672
Using your example how about something like:
IF 0 = Dcount("[MPMS]", "tblproposerMPMS", "[MPMS]='" & Me.MPMSNO & "'") then
MsgBox " You must add MPMS & strNumber & to a Proposer inorder to generate a referral", vbOK
else
RunReport
end if
 

soundsfishy

Registered User.
Local time
Today, 18:16
Joined
Sep 25, 2002
Messages
174
Thanks FoFa!

I'll give that a try.
 

Users who are viewing this thread

Top Bottom