By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,234 Members | 1,832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,234 IT Pros & Developers. It's quick & easy.

Total Records on a Form

P: n/a
I have a form that is based on a query. The form is a vertical colume
layout format. Headers for each colume and then the data is displayed
below it.

I have a control on the Header of the form that I want to display the
total number of records that were returned from the query. How would I
do this?

Everything I try either comes back as #ERROR or #NAME?.

Any on ehave any ideas?

Michael Charney
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Michael,

Put the following expression in the OnOpen event of the form:

Me!NameOfTotalsTextbox = Me.RecordsetClone.RecordCount
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
www.pcdatasheet.com
"Michael Charney" <mb*******@sbcglobal.net> wrote in message
news:3f*********************@news.frii.net...
I have a form that is based on a query. The form is a vertical colume
layout format. Headers for each colume and then the data is displayed
below it.

I have a control on the Header of the form that I want to display the
total number of records that were returned from the query. How would I
do this?

Everything I try either comes back as #ERROR or #NAME?.

Any on ehave any ideas?

Michael Charney
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #2

P: n/a
Might be pure fluke, but I got this to work:

=DCount("[MS_WANC]","Query1","1=1")

Query1 is the object the form is based on, "MS_WANC" is a field in the query...
Nov 12 '05 #3

P: n/a
Michael Charney <mb*******@sbcglobal.net> wrote in message news:<3f*********************@news.frii.net>...
I have a form that is based on a query. The form is a vertical colume
layout format. Headers for each colume and then the data is displayed
below it.

I have a control on the Header of the form that I want to display the
total number of records that were returned from the query. How would I
do this?


If the underlying query is called "qryMyQuery", then try pasting this
in an empty text box.

=DCount("*","qryMyQuery")

HTH

Regards
Stuart
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.