473,378 Members | 1,549 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,378 software developers and data experts.

Question about DCount

I have used DCount() to determine the number of records in a recordset.
Silly me ... I just noticed that DCount returns an INTEGER, which can
hold a maximum value of 32,767. What if the recordset recordcount
exceeds 32,767? Is there a different function that returns a LONG
datatype (which can hold a value upto 2,147,483,647)?

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 11 '07 #1
8 2263
You might try this:

Dlookup("Count(*)","Your_Table")

On 11 Nov 2007 14:26:59 GMT, Susan Bricker <sl*****@verizon.netwrote:
>I have used DCount() to determine the number of records in a recordset.
Silly me ... I just noticed that DCount returns an INTEGER, which can
hold a maximum value of 32,767. What if the recordset recordcount
exceeds 32,767? Is there a different function that returns a LONG
datatype (which can hold a value upto 2,147,483,647)?

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 11 '07 #2
Susan Bricker <sl*****@verizon.netwrote in news:47371132$0$491$815e3792
@news.qwest.net:
I have used DCount() to determine the number of records in a recordset.
Silly me ... I just noticed that DCount returns an INTEGER, which can
hold a maximum value of 32,767. What if the recordset recordcount
exceeds 32,767? Is there a different function that returns a LONG
datatype (which can hold a value upto 2,147,483,647)?

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Where did you notice this? Perhaps you used VarType or TypeName?
TTBOMK DCount which I never use, returns a Variant, and in my expereince, a
variant holding a long integer(long).

Debug.Print TypeName(DCount("*", "Employees", "LastName >= 'B'"))
' long
In versions of Access >=2000 I use

Debug.Print CurrentProject.Connection.Execute("SELECT Count(*) FROM
Employees WHERE LastName >= 'B'")(0)

which I believe is equivalent to:

Debug.Print DCount("*", "Employees", "LastName >= 'B'")

both return 8.

--
lyle fairfield
Nov 11 '07 #3
Susan Bricker <sl*****@verizon.netwrote in
news:47*********************@news.qwest.net:
I have used DCount() to determine the number of records in a
recordset. Silly me ... I just noticed that DCount returns an
INTEGER, which can hold a maximum value of 32,767. What if the
recordset recordcount exceeds 32,767? Is there a different
function that returns a LONG datatype (which can hold a value upto
2,147,483,647)?

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
DCount formally returns a variant, which will automatically switch to
long integer when required. Try it and see.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Nov 11 '07 #4
On Nov 11, 10:08 am, lyle fairfield <lylef...@yahoo.cawrote:
TTBOMK DCount which I never use, returns a Variant, and in my expereince, a
variant holding a long integer(long).
Now there's a stuuuuuuuuuuupid sentence!

Nov 11 '07 #5
Michael,

Thanks for the reply. I apologize for the delay in this response but I
have not been receiving notifications at my home email account that my
post was responded to. I'll look into using Dlookup(). Thanks, again.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 15 '07 #6
Lyle,

I apologize for not responding to your reply earlier, but I never
received notifications (from Developerdex) that my post was responded
to.

As for where I saw that Dcount() returns an Integer ... I'm pretty sure
that I clicked on Help (while working with the VBA) and got the info
from the Online Help for Dcount(). I have A2003, I believe. I'll look
into your suggested solution. Thanks, again.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 15 '07 #7
Bob,

Thanks for your reply. I have not been receiving notifications from
Developerdex that my post was responded to (the reason for my late reply
to you). I will look into Dcount() again. I'm pretty sure, however,
that I looked up the information in the Online Help provided by
Access2003 for Dcount(). Thanks, again.

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 15 '07 #8

"SueB" <sl*****@verizon.netwrote in message
news:47*********************@news.qwest.net...
Bob,

Thanks for your reply. I have not been receiving notifications from
Developerdex that my post was responded to (the reason for my late reply
to you). I will look into Dcount() again. I'm pretty sure, however,
that I looked up the information in the Online Help provided by
Access2003 for Dcount(). Thanks, again.
If you post directly to the newsgroup, you won't face that kind of problem.
If your verizon.net address is valid, then you have access to a news-server
as part of your ISP subscription. Unsurprisingly, it is called
"news.verizon.net" and you can use Outlook Express, which is included with
Internet Explorer, to read and post. If you prefer, there are other
newsreaders, some free, some fee... and many opinions on which is "best".
IE is definitely "free", and though some think it far from best, it works
nicely enough for many of us.

Larry Linson
Microsoft Access MVP
Nov 21 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: jdph40 | last post by:
I posted this problem previously and received excellent help from Wayne Morgan. However, I still have an unanswered question. My form (frmVacationWeeks) is opened from the OnClick event of a...
5
by: Richard Holliingsworth | last post by:
Hello: Thanks for reading this post. I need to create a metrics (form or report - I don't care which) to display calculated fields about the database (A2002 front end to SQL Server 2K) 1) I...
11
by: NC Tim | last post by:
Hello, I think the question i have is fairly straightforward, but I can't seem to replicate the old SAS frequency procedure when I try to accomplish this in MS Access. anyway, i have about 10...
1
by: Chris M. | last post by:
I'm trying to pull the top two people in multiple locations using DCOUNT. If there is a tie for 2nd, my query only shows one person. Table: tblSales-Location, EEID, Units, etc... Query:...
4
by: Will | last post by:
Hi, I had a DCount within a module on records in a table where CustSuffix = 0. I now need to DCount where CustSuffix = 0 and the type of cost Suffix (Suffix in table) = G. I can't get both...
6
by: Mike Conklin | last post by:
This one really has me going. Probably something silly. I'm using dcount for a report to determine the number of different types of tests proctored in a semester. My report is based on a...
3
by: BerkshireGuy | last post by:
I am having difficulty with using the Dcount function. I am trying to return the number of records from qryIndividualFeedbackDetail where the TimelyManner field is set to 4. So, in the new...
2
by: Kaspa | last post by:
Hello I am trying to create dcount field but is not working I have tried every way possible and I can't get it to work. here is my code: =Dcount("","qryTotalscratched"," in (6,7,8,9) and ...
2
by: Wingz | last post by:
Hiya, Fairly new to Access and was wondering what the best way to perform Dcounts on groups in an Access report. For example, I have 10 employees and the different instances of jobs they can...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.