calculation in a subform does not display

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

Guest

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')")
 
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).
 
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')")
 
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.
 
Back
Top