calculation in a subform does not display

L

lynn atkinson

I have a DCount calculation which displays correctly when I view a form.
However when I open the main form which contains it as a subform, the
calculation field displays#Name?
What do I hae to do on the subform to get it to display the calculation
correctly?

The dCount statement is

=DCount("[status]","bookings","[event ID]=" &
[Forms]![multiplebookingsubfrm]![event ID] & "AND [status] IN
('booked','provisional')")
 
V

Van T. Dinh

Try:

= DCount("[status]","bookings", "[event ID]=" &
[Forms]![MainForm]![SubFormControl].Form![event ID] &
" AND [status] IN ('booked','provisional')" )

Replace [MainForm] and [SubFormControl] with proper names from your set-up.
Note that SubFormCONTROL name may be different from the name of the Form
being used as the Subform (more accuarately, being used as the SourceObject
of the SubformControl).
 
L

lynn atkinson

Thanks for the reply.
However, I have lost the plot! What subformCONTROL am I referring to in your
statement?

Van T. Dinh said:
Try:

= DCount("[status]","bookings", "[event ID]=" &
[Forms]![MainForm]![SubFormControl].Form![event ID] &
" AND [status] IN ('booked','provisional')" )

Replace [MainForm] and [SubFormControl] with proper names from your set-up.
Note that SubFormCONTROL name may be different from the name of the Form
being used as the Subform (more accuarately, being used as the SourceObject
of the SubformControl).

--
HTH
Van T. Dinh
MVP (Access)



lynn atkinson said:
I have a DCount calculation which displays correctly when I view a form.
However when I open the main form which contains it as a subform, the
calculation field displays#Name?
What do I hae to do on the subform to get it to display the calculation
correctly?

The dCount statement is

=DCount("[status]","bookings","[event ID]=" &
[Forms]![multiplebookingsubfrm]![event ID] & "AND [status] IN
('booked','provisional')")
 
V

Van T. Dinh

Open the MainForm in DesignView. Open the Properties window. Click once on
the Subform. Make sure the title of the Properties window shows "Subform /
SubReport ..." and the name in the Properties window is the name of the
SubformControl.
 

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