473,405 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Record count help

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
7 2938
Rabbit
12,516 Expert Mod 8TB
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
imz
6
Doesn't work, it gives me an error message in the textbox.
Mar 5 '07 #3
Rabbit
12,516 Expert Mod 8TB
What's the error?
Mar 5 '07 #4
imz
6
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
12,516 Expert Mod 8TB
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
imz
6
It works! Thanks for the help.
Mar 5 '07 #7
Rabbit
12,516 Expert Mod 8TB
Not a problem, glad to help.
Mar 5 '07 #8

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

Similar topics

6
by: Hari Om | last post by:
Here are the details of my error log files: I execute the command and get following message at console: ---------------------------------------------------------------------- ../sqlldr...
5
by: ST | last post by:
Hi, I'm sort of in a rush here...I'm sort of new to vb.net and I'm trying to write the syntax to check a sql table to see if the record already exists based on firstname and lastname text fields...
1
by: Justin Koivisto | last post by:
I am trying to create a report that displays a name of an advertising source and count of the number of times it was hit between certain date ranges. The data is split between two different...
6
by: 6thirty | last post by:
Hi, I've created a stocktaking database using Access XP. This is indexed by two fields - part number and shelf location. I am currently inputting all the data via a form. When I have entered a...
1
by: Scott269 | last post by:
So I've got an old MS Works database I imported into Access. I needed a primary key so I created a record number field that was just the record number I manually inserted when I entered it in the...
1
by: darrel | last post by:
I'm trying to whip up a fancy repeater control that will put records into a two-column table for me. This is how I envision it working: itemtemplate if record count = odd then write out the...
6
by: Opie | last post by:
What would be a more efficient way for me to determine if a record in an SQL DB table exists? Right now, I have a try/catch like this: try {...
4
by: Peter W Johnson | last post by:
Hi guys, I have a problem with a datagrid record count. Here is the code:- <snip> Public Class frmMerchantDeposit Inherits System.Windows.Forms.Form Dim myconnection As New...
3
by: Ray | last post by:
Hello World, I made a Windowsform that reads data from a CSV file. It works fine, but when I have read the data of a record I have to re-Debug the form to read another record. So when I put a...
2
by: John | last post by:
Hi I am using the below statement; Me.MyTableAdapter.Fill(Me.MyDataSet.tblMyTable) How can I now check the record count of the data table and specifically if the record count returned by...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.