DCount with a subform

N

Nathan

I have a main form named frmUpdateCaseEntry
I have a subform named fromCaseFeatureSubform

I want to use an unbound text box on the Main form to show the number of
records in the SUBFORM where a date field (called FeatureDateClosed) is
populated.

I tried this in my unbound field:
=DCount([FeatureDateClosed],[Forms]![frmupdatecaseentry]![fromCaseFeatureSubform].[Form],Not Null)

I also tried:
=DCount([FeatureDateClosed],[fromCaseFeatureSubform].[Form],Not Null)

Neither worked - I am getting a #Name? error. Any ideas?
 
S

strive4peace

Hi Nathan,

put the calculation in the footer of your subform

Name --> CountFeatureDateClosed
ControlSource -->
=Sum(IIF( not isnull(FeatureDateClosed),1,0 ))

you do not need this control to show -- its visible property
can be No

then, on the main form
ControlSource -->
=subform_controlname.form.CountFeatureDateClosed

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
N

Nathan

AWESOME! It worked! Thanks a million!

strive4peace" <"strive4peace2006 at yaho said:
Hi Nathan,

put the calculation in the footer of your subform

Name --> CountFeatureDateClosed
ControlSource -->
=Sum(IIF( not isnull(FeatureDateClosed),1,0 ))

you do not need this control to show -- its visible property
can be No

then, on the main form
ControlSource -->
=subform_controlname.form.CountFeatureDateClosed

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
I have a main form named frmUpdateCaseEntry
I have a subform named fromCaseFeatureSubform

I want to use an unbound text box on the Main form to show the number of
records in the SUBFORM where a date field (called FeatureDateClosed) is
populated.

I tried this in my unbound field:
=DCount([FeatureDateClosed],[Forms]![frmupdatecaseentry]![fromCaseFeatureSubform].[Form],Not Null)

I also tried:
=DCount([FeatureDateClosed],[fromCaseFeatureSubform].[Form],Not Null)

Neither worked - I am getting a #Name? error. Any ideas?
 
S

strive4peace

you're welcome, Nathan ;) happy to help


Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
AWESOME! It worked! Thanks a million!

:

Hi Nathan,

put the calculation in the footer of your subform

Name --> CountFeatureDateClosed
ControlSource -->
=Sum(IIF( not isnull(FeatureDateClosed),1,0 ))

you do not need this control to show -- its visible property
can be No

then, on the main form
ControlSource -->
=subform_controlname.form.CountFeatureDateClosed

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
I have a main form named frmUpdateCaseEntry
I have a subform named fromCaseFeatureSubform

I want to use an unbound text box on the Main form to show the number of
records in the SUBFORM where a date field (called FeatureDateClosed) is
populated.

I tried this in my unbound field:
=DCount([FeatureDateClosed],[Forms]![frmupdatecaseentry]![fromCaseFeatureSubform].[Form],Not Null)

I also tried:
=DCount([FeatureDateClosed],[fromCaseFeatureSubform].[Form],Not Null)

Neither worked - I am getting a #Name? error. Any ideas?
 

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

verify a date in a subform 1
macro/subform event 2
DCount problem redux 4
Still struggling with DCount 9
Populate main form from subform record 0
DCount 2
Unremovable horizontal scroll bar on subform 1
Subform 7

Top