473,324 Members | 2,501 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,324 software developers and data experts.

DCount() Usage

36
Here is the real example issue:

I have a table named [products]. I need to count only one in list.

[ID] [ProdName] [price]
1 paper $1.00
1 paper $1.00
2 pencil $2.00

=Dcount([tblproducts],[ID], [ProdNamed]="Papaer") - This is correct? I need to count in the text box report only the paper product. But no work the Dcount to diference count.

¿How?

Thanks for your time. Excuses for my english.
Apr 3 '08 #1
4 1372
Scott Price
1,384 Expert 1GB
Good afternoon, El Tipo,

Yes this should result in a count of the ID's associated with 'Paper'. Does it work?

Si, debe funcionar cómo quieres, contando el número de registros de 'Papel'. ¿Funciona?

¡Que tengas un buen día!

Scott
Apr 3 '08 #2
missinglinq
3,532 Expert 2GB
The syntax for DCount() using a text criteria is
Expand|Select|Wrap|Line Numbers
  1. DCount("[Field Name]", "[TableName]", "Criteria ='string'")
  2.  
I could be wrong, but I assume that tblProducts is probably a table name, not a field name, and that ID is a field name, not a table name. I haven't used this in a while, but I believe you'll also have to imclude both the field and table names inside of double quotation marks as well.

Also, is ProductNamed actually "Papaer" or should it be "Paper?" I only ask becaues of the language difference?

Linq ;0)>
Apr 3 '08 #3
NeoPa
32,556 Expert Mod 16PB
Linq is absolutely right :)
  • Papaer (or Paper) should be enclosed in SINGLE-quotes (')
  • [tblProducts] & [ID] are in the wrong order
  • ALL the parameters should be enclosed in DOUBLE-quotes
Expand|Select|Wrap|Line Numbers
  1. =DCount("[ID]", "[tblproducts]", "[ProdNamed]='Papaer'")
Apr 3 '08 #4
Scott Price
1,384 Expert 1GB
You both are correct :-) Thanks for catching my error... I overlooked the transposition of the table name and field name.

El Tipo, did you understand what they are saying? ¿Entendiste lo que estan diciendo?

Regards,
Scott
Apr 3 '08 #5

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

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...
1
by: Megan | last post by:
Hi Everybody- I've been reading some of the posts about DCOUNT, and I haven't yet found an answer; so, I'm posting this question. I have a report that I'm trying to use DCOUNT on to compute...
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...
2
by: Paul T. RONG | last post by:
Hi, I have a problem with DCount, the following code doesn't work: DCount("", "qryOrder", "( = Me! AND = 'drink')" > 0 Please help. Thank you.
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: ChasW | last post by:
Greetings, I have a form that uses a query as its record source. In the form I have a text box that uses this as its control source: =DCount("", "qry_Search_by_Name") The DCount function...
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.