G
Guest
Hi All,
Any assistance will be appreciated.
I have a subform "frmpayments" within a form "frminvoice" and a command
button opening a report "rptInvoice", the problem is if there is no payment
or record on the "frmpayments" when i click on the command button i get a
Run-Time Error '2427'.
It appears there must be a record in the subform "frmPayments" OR i'm hoping
there maybe an alternative.
The Run-Time Error refers to the following when i click on Debug, which of
course works perfectly when there's a record in subfrom "frmPayments".
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.Debtor.Value = 2 Then
Me.AccountsName.Visible = False
Me.AccountsAddress.Visible = False
Me.AccountsSuburb.Visible = False
Me.InvoiceOwner.Visible = True
Me.InvoiceAddress.Visible = True
Me.InvoiceSuburb.Visible = True
Else
Me.AccountsName.Visible = True
Me.AccountsAddress.Visible = True
Me.AccountsSuburb.Visible = True
Me.InvoiceOwner.Visible = False
Me.InvoiceAddress.Visible = False
Me.InvoiceSuburb.Visible = False
End If
End Sub
Any assistance will be appreciated.
I have a subform "frmpayments" within a form "frminvoice" and a command
button opening a report "rptInvoice", the problem is if there is no payment
or record on the "frmpayments" when i click on the command button i get a
Run-Time Error '2427'.
It appears there must be a record in the subform "frmPayments" OR i'm hoping
there maybe an alternative.
The Run-Time Error refers to the following when i click on Debug, which of
course works perfectly when there's a record in subfrom "frmPayments".
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.Debtor.Value = 2 Then
Me.AccountsName.Visible = False
Me.AccountsAddress.Visible = False
Me.AccountsSuburb.Visible = False
Me.InvoiceOwner.Visible = True
Me.InvoiceAddress.Visible = True
Me.InvoiceSuburb.Visible = True
Else
Me.AccountsName.Visible = True
Me.AccountsAddress.Visible = True
Me.AccountsSuburb.Visible = True
Me.InvoiceOwner.Visible = False
Me.InvoiceAddress.Visible = False
Me.InvoiceSuburb.Visible = False
End If
End Sub