By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,081 Members | 2,118 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.

Record count help

P: 6
I am trying to count the records of a query result and place the answer into a textbox on a form. I have found the DCount function in the help files and tried the following code:

= DCount("[MonthlyFeeID]", "Monthly Fees Query")

I keep getting an error about placing something before the equals sign, but I don't know what to put there.

Thanks
Mar 5 '07 #1
Share this Question
Share on Google+
7 Replies


Rabbit
Expert Mod 10K+
P: 12,366
I am trying to count the records of a query result and place the answer into a textbox on a form. I have found the DCount function in the help files and tried the following code:

= DCount("[MonthlyFeeID]", "Monthly Fees Query")

I keep getting an error about placing something before the equals sign, but I don't know what to put there.

Thanks
Put this in the control source of the text box:
Expand|Select|Wrap|Line Numbers
  1. =DCount("*", "[Montly Fees Query]")
Mar 5 '07 #2

P: 6
imz
Doesn't work, it gives me an error message in the textbox.
Mar 5 '07 #3

Rabbit
Expert Mod 10K+
P: 12,366
What's the error?
Mar 5 '07 #4

P: 6
imz
There is an "#Error" message that appears inside the textbox when I open it on form view. I should mention that there are no fields on my form, so i'm guessing that's why your method does not work.

I'm trying to make the record count appear on the main menu screen and unless I put the query fields on the form I think they won't work. I don't want to do that because I want another record count and I can't put 2 different query fields on one form without therefore being a subform. For this reason i thought using Dcount in VBA would be the answer.
Mar 5 '07 #5

Rabbit
Expert Mod 10K+
P: 12,366
You don't need the table bound to the form for DCount to work. It should work.

Edit: I just noticed that I had a typo in my code. I spelled Monthly wrong. Fix that and see if it works.
Mar 5 '07 #6

P: 6
imz
It works! Thanks for the help.
Mar 5 '07 #7

Rabbit
Expert Mod 10K+
P: 12,366
Not a problem, glad to help.
Mar 5 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.