D
Dave Elliott
I have a Deposit Slip form and it checks for criteria upon the command click
event so it will close If...
It shows me thi serror when it closes;
The expression you entered refers to an object that is closed or doesn't
exist
What am I missing? For the form to close, the Payee must be null (Cust1)
and Printed must be true (-1) , it is a yes/no field in table, checkbox on
form.
0 means it has not been printed
On Error GoTo Err_Command108_Click
DoCmd.SetWarnings False
If Printed = 0 And Not IsNull([cust1]) Then 'It has not been printed
and there is a customer (Payee)
MsgBox "Deposits Must Be Printed"
MsgBox "You Can Minimize and Print Later"
Command84.SetFocus , Set focus on
Print Button
Cancel = True
End If
If Printed = 0 And IsNull([cust1]) Then ' Deposit is not
printed and there is no customer (Payee)
DoCmd.Close acForm, Me.Name
End If
If Not IsNull([cust1]) And Printed = -1 Then ' There is a customer
(Payee) and it has been printed
DoCmd.Close acForm, Me.Name
End If
Exit_Command108_Click:
Exit Sub
Err_Command108_Click:
MsgBox err.Description
Resume Exit_Command108_Click
event so it will close If...
It shows me thi serror when it closes;
The expression you entered refers to an object that is closed or doesn't
exist
What am I missing? For the form to close, the Payee must be null (Cust1)
and Printed must be true (-1) , it is a yes/no field in table, checkbox on
form.
0 means it has not been printed
On Error GoTo Err_Command108_Click
DoCmd.SetWarnings False
If Printed = 0 And Not IsNull([cust1]) Then 'It has not been printed
and there is a customer (Payee)
MsgBox "Deposits Must Be Printed"
MsgBox "You Can Minimize and Print Later"
Command84.SetFocus , Set focus on
Print Button
Cancel = True
End If
If Printed = 0 And IsNull([cust1]) Then ' Deposit is not
printed and there is no customer (Payee)
DoCmd.Close acForm, Me.Name
End If
If Not IsNull([cust1]) And Printed = -1 Then ' There is a customer
(Payee) and it has been printed
DoCmd.Close acForm, Me.Name
End If
Exit_Command108_Click:
Exit Sub
Err_Command108_Click:
MsgBox err.Description
Resume Exit_Command108_Click