dcount

  • Thread starter Thread starter brian
  • Start date Start date
B

brian

I have a form with a subform. The subform has a filter
based upon the parameters of the primary form. I would
like to add an unbound field in the primary form that
counts the number of records in the subform. I am trying
to use the dcount function but it returns "#Name?". Is
my attempt possible?
 
Try setting the Control Source of your subform to:
=[NameOfYourSubformControHere].Form.RecordsetClone.Count

Not sure if Access will keep that up to date for you without a Recalc.
 
Allen, Thanks for the idea. Unfortuanately I am still
getting the #Name? when I input "=['frmTabDeposit
subform'].Name.RecordsetClone.Count" into the Control
source. Any other ideas?
-----Original Message-----
Try setting the Control Source of your subform to:
=[NameOfYourSubformControHere].Form.RecordsetClone.Count

Not sure if Access will keep that up to date for you without a Recalc.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have a form with a subform. The subform has a filter
based upon the parameters of the primary form. I would
like to add an unbound field in the primary form that
counts the number of records in the subform. I am trying
to use the dcount function but it returns "#Name?". Is
my attempt possible?


.
 
ON A SUBFORM
create a textbox
with this controlsource
=count(*)
name it example number_of_rec
place it on a invisible section

on a main form
create a text box
with a controlsource
=subformname.form.numer_of_rec


enjoy
:-)

FLAVIO







brian said:
Allen, Thanks for the idea. Unfortuanately I am still
getting the #Name? when I input "=['frmTabDeposit
subform'].Name.RecordsetClone.Count" into the Control
source. Any other ideas?
-----Original Message-----
Try setting the Control Source of your subform to:
=[NameOfYourSubformControHere].Form.RecordsetClone.Count

Not sure if Access will keep that up to date for you without a Recalc.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have a form with a subform. The subform has a filter
based upon the parameters of the primary form. I would
like to add an unbound field in the primary form that
counts the number of records in the subform. I am trying
to use the dcount function but it returns "#Name?". Is
my attempt possible?


.
 
Brian, open the main form in design view.
Right-click on the edge of the subform control, and choose Properties.
Double-check the Name property ("Other" tab).
The Name may be different from the SourceObject (the name of the form
contained in the subform control).

If that still doesn't work, you may have a references problem. Details:
http://allenbrowne.com/ser-38.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

brian said:
Allen, Thanks for the idea. Unfortuanately I am still
getting the #Name? when I input "=['frmTabDeposit
subform'].Name.RecordsetClone.Count" into the Control
source. Any other ideas?
-----Original Message-----
Try setting the Control Source of your subform to:
=[NameOfYourSubformControHere].Form.RecordsetClone.Count

Not sure if Access will keep that up to date for you without a Recalc.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have a form with a subform. The subform has a filter
based upon the parameters of the primary form. I would
like to add an unbound field in the primary form that
counts the number of records in the subform. I am trying
to use the dcount function but it returns "#Name?". Is
my attempt possible?


.
 
Back
Top