#Error When using a subform field on a main form...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

good day all...

I have an invoices form that I am using the following controls, however,
if the controls have no data, the control shows #Error... is there a way to
prevent this?

Payoff =IIf([NewAmountDue]=0,"Payoff Date","Last Payment Date")

PaymentDate =frminvoicepaymentssubform.Form!LastPaymentDate

NewAmountDue=frminvoicepaymentssubform.Form!MaxPaymentAmount

Any suggestions greatly appreciated ...

thanks...
Brook
 
Brook said:
I have an invoices form that I am using the following controls, however,
if the controls have no data, the control shows #Error... is there a way to
prevent this?

Payoff =IIf([NewAmountDue]=0,"Payoff Date","Last Payment Date")

PaymentDate =frminvoicepaymentssubform.Form!LastPaymentDate

NewAmountDue=frminvoicepaymentssubform.Form!MaxPaymentAmount


You can use the IsError function to test for that situation.

It looks intimidating with those long names, but the idea is
simple:

=IIf(IsError(frminvoicepaymentssubform.Form!LastPaymentDate),
0, frminvoicepaymentssubform.Form!LastPaymentDate)

Note that in a report-subreport scenario, you can use the
HasData property instead:

=IIf(rptinvoicepaymentssubreport.Report!LastPaymentDate.HasData,
rptinvoicepaymentssubreport.Report!LastPaymentDate, 0)
 
Perfect!!!

Thank you so much...

I used the following:

=IIf(IsError(frminvoicepaymentssubform.Form!LastPaymentDate), 0,
frminvoicepaymentssubform.Form!LastPaymentDate)

Brook

Marshall Barton said:
Brook said:
I have an invoices form that I am using the following controls, however,
if the controls have no data, the control shows #Error... is there a way to
prevent this?

Payoff =IIf([NewAmountDue]=0,"Payoff Date","Last Payment Date")

PaymentDate =frminvoicepaymentssubform.Form!LastPaymentDate

NewAmountDue=frminvoicepaymentssubform.Form!MaxPaymentAmount


You can use the IsError function to test for that situation.

It looks intimidating with those long names, but the idea is
simple:

=IIf(IsError(frminvoicepaymentssubform.Form!LastPaymentDate),
0, frminvoicepaymentssubform.Form!LastPaymentDate)

Note that in a report-subreport scenario, you can use the
HasData property instead:

=IIf(rptinvoicepaymentssubreport.Report!LastPaymentDate.HasData,
rptinvoicepaymentssubreport.Report!LastPaymentDate, 0)
 
Back
Top