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

How do I find the count of records in a 2nd table

P: n/a
Ron
Hi all,

I've got a form (frmOne) based on a query (qryOnFirstTable). On this form
is a button that when pressed, needs to total the records in another query
(qryOnSecondTable) and then shows how many records are in this 2nd table
that apply to what we're doing on that first table. I can't just "show"
that number though...it's got to be a variable or something that I can
manipulate from there...like automatically add records to the first table
corresponding to the total of the records in the second.

How can I do that? I've got the form doing precisely what I want, but I
have to open the second file, get that number at the bottom, and manually
put it into a control on the 1st form to get it to do what I want. I just
can't figure out a way to get that number automatically without the operator
having to look it up somehow. Is that even possible?

TIA
ron
Sep 10 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Look up DCount() in VBA Help.

Ron wrote:
>Hi all,

I've got a form (frmOne) based on a query (qryOnFirstTable). On this form
is a button that when pressed, needs to total the records in another query
(qryOnSecondTable) and then shows how many records are in this 2nd table
that apply to what we're doing on that first table. I can't just "show"
that number though...it's got to be a variable or something that I can
manipulate from there...like automatically add records to the first table
corresponding to the total of the records in the second.

How can I do that? I've got the form doing precisely what I want, but I
have to open the second file, get that number at the bottom, and manually
put it into a control on the 1st form to get it to do what I want. I just
can't figure out a way to get that number automatically without the operator
having to look it up somehow. Is that even possible?

TIA
ron
--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via http://www.accessmonster.com

Sep 10 '07 #2

P: n/a
On Mon, 10 Sep 2007 23:09:00 GMT, Ron wrote:
Hi all,

I've got a form (frmOne) based on a query (qryOnFirstTable). On this form
is a button that when pressed, needs to total the records in another query
(qryOnSecondTable) and then shows how many records are in this 2nd table
that apply to what we're doing on that first table. I can't just "show"
that number though...it's got to be a variable or something that I can
manipulate from there...like automatically add records to the first table
corresponding to the total of the records in the second.

How can I do that? I've got the form doing precisely what I want, but I
have to open the second file, get that number at the bottom, and manually
put it into a control on the 1st form to get it to do what I want. I just
can't figure out a way to get that number automatically without the operator
having to look it up somehow. Is that even possible?

TIA
ron
In an unbound text control on either form:
= DCount("*","QueryName")

will return the number of records in that that query.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Sep 10 '07 #3

P: n/a
Ron
Put this in my button click on the main form and it all works like a dream
come true. I know I thanked you in advance, but wanted to say thanks again,
to both of you for the quick responses.

ron

"fredg" <fg******@example.invalidwrote in message
news:rj****************************@40tude.net...
On Mon, 10 Sep 2007 23:09:00 GMT, Ron wrote:
>Hi all,

I've got a form (frmOne) based on a query (qryOnFirstTable). On this
form
is a button that when pressed, needs to total the records in another
query
(qryOnSecondTable) and then shows how many records are in this 2nd table
that apply to what we're doing on that first table. I can't just "show"
that number though...it's got to be a variable or something that I can
manipulate from there...like automatically add records to the first table
corresponding to the total of the records in the second.

How can I do that? I've got the form doing precisely what I want, but I
have to open the second file, get that number at the bottom, and manually
put it into a control on the 1st form to get it to do what I want. I
just
can't figure out a way to get that number automatically without the
operator
having to look it up somehow. Is that even possible?

TIA
ron

In an unbound text control on either form:
= DCount("*","QueryName")

will return the number of records in that that query.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Sep 11 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.