If Statement Syntax and Placement Help Needed !

D

Dave Elliott

On my form the criteria needed is a {Cust1}, i.e. (Payee); Deposit Number
[Counter] , and if these are met, then you can print the deposit, i.e.
Printed =1
Printed is a check box and in table a yes/no control, it's default is set to
0
If printed is 1 and there is no [Cust1] or [Counter] then Printed = 0. The
code below is on the Print Deposit Command Button.
You cant Print if there is no Count,Cust1 or Printed is 0
4th criteria is throwing me off.


Dim stDocName As String, stLinkCriteria
stDocName = "Deposits"
DoCmd.OpenReport stDocName, acNormal
Printed = 1

If IsNull(Counter) Then
MsgBox "Number of Deposits Please "
Cancel = True
End If

If IsNull([Customers]) Then
MsgBox "Payee is Needed Please"
Customers.SetFocus
Exit Sub
End If


If Printed = 0 Then
MsgBox "Deposits Must Be Printed"
MsgBox "You Can Minimize and Print Later"
Command84.SetFocus
Cancel = True
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top