Accessing a forms or subforms recordset from a text box. to be able to use DCount etc

K

Kevin Vaughan

Hi y'all,
Does anyone know if it is possible to put a DCount into a text box on a form
with the DCount Recordset equalling the form's CURRENT recordset - not just
the one it is opened up with but the current one which may be filtered?

Or should I go about this in a different manner?

Thanks in anticipation.
Regards
Kevin Vaughan
 
W

Wayne Morgan

When you turn the filter on and off, you will get an OnCurrent event for the form. In that
event, you could check the filter status of the form (on or off) and change the control
source of the control. You would apply the filter to the DCount's where part.

Are all of the values you are counting part of the form's recordset? If so, you may be
able to use

=Count([FieldName])

instead. This will auto adjust when you filter the form.
 
M

Marshall Barton

Kevin said:
Does anyone know if it is possible to put a DCount into a text box on a form
with the DCount Recordset equalling the form's CURRENT recordset - not just
the one it is opened up with but the current one which may be filtered?

No, DCount operates on a table or query, not a recordset.

What are you trying to count?
 

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