Testing for records in a subform

D

Dave

I have a subform that displays a set of child records based on the current
record in the parent form.

On the parent form is a text box that displays the count of associated
records in the child form.

Some parent form records have no associated child records. If there are no
assocaited child records, the record count text box displays an error.

How can I handle this error? IOW, how can I test for the presence of
associated child records before displaying anything in the count text box?
 
M

Marshall Barton

Dave said:
I have a subform that displays a set of child records based on the current
record in the parent form.

On the parent form is a text box that displays the count of associated
records in the child form.

Some parent form records have no associated child records. If there are no
assocaited child records, the record count text box displays an error.

How can I handle this error? IOW, how can I test for the presence of
associated child records before displaying anything in the count text box?


How are you calculating the count of subform records??

Normally, this would be done by using a text box in the
subform's header/footer section with the expression
=Count(*). The main form text box would then use the
expression =subformcontrol.Form.subformtextbox

With that arrangement, AFAIK, you would get 0, not #Error
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top