dcount

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?
 
A

Allen Browne

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.
 
B

brian

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?


.
 
F

Flavio Software House

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?


.
 
A

Allen Browne

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?


.
 

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

Similar Threads

DCount problem redux 4
Still struggling with DCount 8
Access Dcount (multiple criteria) 3
Access Dcount function in access 0
DCount with a subform 3
dcount 1
DCount in a subform 7
Display Count of records from subform on Main form 7

Top