Hi all,
I am getting a runtime error when I am referencing a control of an open form in the module I created to print a report. I want to print a report if there is any value other than "0" in the txtbox of the form called DropAmount. I needed to create a module for the print job to be submitted for various reasons. so couldn't do me.dropamount <> 0 (it worked when I did a print code from the form itself with "Me.dropamount).
I am getting a runtime error when I am referencing a control of an open form in the module I created to print a report. I want to print a report if there is any value other than "0" in the txtbox of the form called DropAmount. I needed to create a module for the print job to be submitted for various reasons. so couldn't do me.dropamount <> 0 (it worked when I did a print code from the form itself with "Me.dropamount).
Code:
Public Sub PrintDrop()
'Printing a Drop
If [Forms]![FrmBankReturns]![SubFrmBanksReturn].DropAmount <> 0 Then
DoCmd.OpenReport "RptDropFrm", acViewNormal, "", "[ID]=[Forms]![FrmBankReturns]![SubFrmBanksReturn]![ID]", acNormal, OpenArgs:="Cashier Copy"
DoCmd.OpenReport "RptDropFrm", acViewNormal, "", "[ID]=[Forms]![FrmBankReturns]![SubFrmBanksReturn]![ID]", acNormal, OpenArgs:="Employee Copy"
CKGoodPrintOut
End If
End Sub