Hi Group:
I know their is an easy answer to this but I can't seem to figure this out.
Main Form Name = "frmPostVoucher
Sub Form Name = "frmPostVoucherSubPrint"
**I want to test if there are no records or null
**I can sucessfully test if there is more than 1 record
**I have tried the following:
** Forms![frmPostVoucher]![frmPostVoucherSubPrint].Form![txtPrintCount] = Null
** IsNull(Forms![frmPostVoucher]![frmPostVoucherSubPrint].Form![txtPrintCount])
See below
Private Sub CmdClose_Click()
On Error GoTo Err_CmdClose_Click
If ckPrint = 0 And Forms![frmPostVoucher]![frmPostVoucherSubPrint].Form![txtPrintCount] = Null Then
DoCmd.Close
ElseIf ckPrint = 0 And Forms![frmPostVoucher]![frmPostVoucherSubPrint].Form![txtPrintCount] >= 1 Then
MsgBox "You cannot exit until you print off the Voucher and or deselect the records for printing.", vbExclamation, "Program Accounting"
Exit Sub
End If
Exit_CmdClose_Click:
Exit Sub
Err_CmdClose_Click:
MsgBox Err.Description
Resume Exit_CmdClose_Click
End Sub
I know their is an easy answer to this but I can't seem to figure this out.
Main Form Name = "frmPostVoucher
Sub Form Name = "frmPostVoucherSubPrint"
**I want to test if there are no records or null
**I can sucessfully test if there is more than 1 record
**I have tried the following:
** Forms![frmPostVoucher]![frmPostVoucherSubPrint].Form![txtPrintCount] = Null
** IsNull(Forms![frmPostVoucher]![frmPostVoucherSubPrint].Form![txtPrintCount])
See below
Private Sub CmdClose_Click()
On Error GoTo Err_CmdClose_Click
If ckPrint = 0 And Forms![frmPostVoucher]![frmPostVoucherSubPrint].Form![txtPrintCount] = Null Then
DoCmd.Close
ElseIf ckPrint = 0 And Forms![frmPostVoucher]![frmPostVoucherSubPrint].Form![txtPrintCount] >= 1 Then
MsgBox "You cannot exit until you print off the Voucher and or deselect the records for printing.", vbExclamation, "Program Accounting"
Exit Sub
End If
Exit_CmdClose_Click:
Exit Sub
Err_CmdClose_Click:
MsgBox Err.Description
Resume Exit_CmdClose_Click
End Sub