Problem with Class Module

Louise

Registered User.
Local time
Today, 14:29
Joined
Oct 28, 1999
Messages
26
I have what should be a simple task. I have a command button on one form that opens another form with an SQL string as the linking criteria. Depending on which record I am in, there may or may not be details to show in the second form. At the moment because the second form needs to be read only, when there are no details to show it opens a completely blank form.

I am trying to have it so that if there are no details then it simply pops up a message box to say "There are no details". I have been trying to use IsNull or Not, but I need some help with the syntax. I have listed the original code below:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Paymentmain"
stLinkCriteria = "[Cont_Id]=" & Me![Contract_Id]

DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms![Paymentmain]![WBCID] = Me![WBC_Contract_ID]
Forms![Paymentmain]![Vendor] = Me![Vendor_Name]
 

Users who are viewing this thread

Back
Top Bottom