Dcount Problem

I know this is an elementary problem but the more I try to fix it the
more confused I get. I need some simple help here. I have searched the
Group for an answer but can't find one so here goes.
-----------------------------------
I have a form that contains a Dcount. I can't seem to get the syntax
correct.

Table name: tblNameList
Field: option1. This field only contains one of two records both
currency. It either contains $0.00 or $15.00.

I am trying to count the number of times that $15.00 appears in the
field option1.

The Dcount I am trying is this but I get an error.

=DCount([tblNameList]![option1],"tblNameList",[tblNameList]![option1]
="$15.00")

What am I doing wrong? Any help would be appreciated.
Thanks in advance.

0
Judy
2/3/2010 5:20:20 PM
access.forms 6864 articles. 2 followers. Follow

3 Replies
1130 Views

Similar Articles

[PageSpeed] 5

There are some syntax problems with your DCount.  Try:

=DCount("[option1]","tblNameList","[option1] = " & 15)

For future reference, be as specific as possible about errors that arise.
The details of the error can make all the difference.

Judy wrote:
>I know this is an elementary problem but the more I try to fix it the
>more confused I get. I need some simple help here. I have searched the
>Group for an answer but can't find one so here goes.
>-----------------------------------
>I have a form that contains a Dcount. I can't seem to get the syntax
>correct.
>
>Table name: tblNameList
>Field: option1. This field only contains one of two records both
>currency. It either contains $0.00 or $15.00.
>
>I am trying to count the number of times that $15.00 appears in the
>field option1.
>
>The Dcount I am trying is this but I get an error.
>
>=DCount([tblNameList]![option1],"tblNameList",[tblNameList]![option1]
>="$15.00")
>
>What am I doing wrong? Any help would be appreciated.
>Thanks in advance.

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/201002/1

0
BruceM
2/3/2010 6:59:54 PM
Try omitting quotes and dollar sign.
-- 
Build a little, test a little.


"Judy" wrote:

> I know this is an elementary problem but the more I try to fix it the
> more confused I get. I need some simple help here. I have searched the
> Group for an answer but can't find one so here goes.
> -----------------------------------
> I have a form that contains a Dcount. I can't seem to get the syntax
> correct.
> 
> Table name: tblNameList
> Field: option1. This field only contains one of two records both
> currency. It either contains $0.00 or $15.00.
> 
> I am trying to count the number of times that $15.00 appears in the
> field option1.
> 
> The Dcount I am trying is this but I get an error.
> 
> =DCount([tblNameList]![option1],"tblNameList",[tblNameList]![option1]
> ="$15.00")
> 
> What am I doing wrong? Any help would be appreciated.
> Thanks in advance.
> 
> .
> 
0
Utf
2/3/2010 7:31:02 PM
On Wed, 3 Feb 2010 09:20:20 -0800 (PST), Judy <aaca75@gmail.com> wrote:

>I know this is an elementary problem but the more I try to fix it the
>more confused I get. I need some simple help here. I have searched the
>Group for an answer but can't find one so here goes.
>-----------------------------------
>I have a form that contains a Dcount. I can't seem to get the syntax
>correct.
>
>Table name: tblNameList
>Field: option1. This field only contains one of two records both
>currency. It either contains $0.00 or $15.00.
>
>I am trying to count the number of times that $15.00 appears in the
>field option1.
>
>The Dcount I am trying is this but I get an error.
>
>=DCount([tblNameList]![option1],"tblNameList",[tblNameList]![option1]
>="$15.00")
>
>What am I doing wrong? Any help would be appreciated.
>Thanks in advance.

Several things.

First off, DCount doesn't count fields - it counts the number of *records* in
the table or query which match the (optional) critirion in the third argument.

Secondly, all three arguments of DCount must be Strings. The first is what
you'll be counting; it's simplest just to use "*" in a case like this, because
you're just counting records. The second argument is the name of a Table or a
Query in which you're counting records, again as a text string. The third
argument is a valid SQL WHERE clause, without the word WHERE, specifying which
records you want to count. 

The exact syntax depends on the Datatype of the field named Option1. If the
field is a Currency or Number, then use

=DCount("*", "tblNameList", "[Option1] = 15")

If the field is Text and actually contains the literal text string "$15.00"
then use

=DCount("*", "tblNameList", "[Option1] = '$15.00'")

using ' as a delimeter for the string criterion.
-- 

             John W. Vinson [MVP]
0
John
2/3/2010 11:33:08 PM
Reply:

Similar Artilces:

Word problems
When I go to paste something into a blank Word document, a pop up says - not enough memory. I find it very strange. I have Firefox and XP Any ideas please. Thank you Katherine So you have winxp, but what version of Word? "jones" <jones@nowhere.com> wrote in message news:4b3754da$1@dnews.tpgi.com.au... > When I go to paste something into a blank Word document, a pop up says - > not enough memory. I find it very strange. > > I have Firefox and XP > > Any ideas please. > > Thank you > Katherine > > I'm ...

Task Schedular Problem.
Hello, I have several tasks and apps that have been scheduled to run and have been working for some time. Now the tasks seem to run, but do not work interactively (by this I mean there is no window or app displayed on the desktop). If I look at Task Manage, I can see it in the list, but nothing on screen. I created a new taks several times today for "cmd.exe". Again, it shows up in Task manager, but nada. I reset my password, the administrator password and even created a new account belonging to the Admin Group. Same thing? Windows XP, SP3 with all the hotfixes,...

Problems with Sales for Outlook reinstall
Hello, I'm trying to reinstall the sales for Outlook on my client machine. But at the end of the install process, I got a fatal error : ' Install failure due to an error. The install software was unable to install .msi file for the Sales for Outlook' Do you have any idea ? Thanks for advance -- Michael MARTIN BrainSoft (France) Dear Michael, Fisrt did you uninstall the SFO CRM, then be sure your delete the database from the MSDE, and be sure you have latest windows installer. "Michael MARTIN" wrote: > Hello, > > I'm trying to reinstall the sal...

ESM 2003 Help Crash
Using any of the help screens in ESM 2003 causes ESM to crash. This is apparently a conflict with Exchange 2003 SP2 and IE7. Here's an article about it: http://searchexchange.techtarget.com/tip/0,289483,sid43_gci1233854,00.html Is there a fix, or is Microsoft planning fix? This is underway. -- This posting is provided "AS IS" with no warranties, and confers no rights. Dgoldman http://blogs.msdn.com/dgoldman "Dave B" <daveb@atgnet.com> wrote in message news:%23Jg6weoLHHA.1816@TK2MSFTNGP06.phx.gbl... > Using any of the help screens in ESM 2003 cau...

Protection/Sorting problem
I locked certain cells on my worksheet, and then protected the worksheet. However, now I wish to sort the data, but keep the data that was protected protected. Since certain cells are locked and not data, when I sort only those same cells are protected, rather than the data being protected. Is there any way I can protect the data instead? Thanks for the help! ...

Problem while processing Reconcile
We have a purchase order with 20 line items, we have received 17 of it and 3 of the line items are cancelled. Now, the status of the purchase order is closed and the status of 17 lineitems is received while the other 3 line items are cancelled. Now, reconcile was performed. It showed a report stating that error occurred in that particular purchase order and the status of line items as cancelled are changed to received and the status of the purchase order is changed from closed to open. What's the problem? Why it is happening? How to make it function correctly? Thanks for the hel...

Calendering Problem
When a user sends a meeting request to somebody it automatically appears in their calender without them accepting it. Is there anyway this can be turned off so meetings appear only when they've been accepted? Thanks Amanda, It sounds like this perons's calendar as been setup as a resource. Have the meeting recipient go to Tools, Options, click Calendar Options the click Resource Scheduling. Have them make sure that those checkboxes have not been selected. "Amanda Harding" <amanda.harding@wulvernhousing.org.uk> wrote in message news:113d901c44182$ecbf4b10$a00...

Replying problem
I am unable to reply to received e-mails. The error is '551 delivery not allowed to non-local recipient' Can anyone help? ...

access problem
I store leads on my Phillips CD burner from Windows XP Professional. Normally I have no problems pulling up files from the CD. However following a email program with World Merge, I found that I could not access my Excel Files on the CD. The error message was : "You don't have access to this folder'E:\..See your administrator for access to this folder. I am lost any help out there? Thanks Hal On Fri, 24 Oct 2003 14:45:11 -0700, "Hal Harding" <anonymous@discussions.microsoft.com> wrote: >I store leads on my Phillips CD burner from Windows XP >Professi...

Book.xlt problems
When I open Excel (Excel 2002) for the first time, it opens the Book.xlt template. However, when I am in Excel and go File - New - Blank Workbook, it does not use the Book.xlt as the default for the new workbook. Anyone know how to fix this so that when I want a new workbook from within Excel, it uses the Book.xlt template? I have customized Book.xlt and Sheet.xlt files in the Documents and Settings/.../Application Data/Microsoft/Excel/Xlstart directory and nowhere else. Thanks in advance, Keith Keith Tools>Customize>Commands>File. Drag the "New" button to your File...

crm and e-mail problem.
hi when i try to send en e-mail i recive en error: unexpected error contect you system menager. if i look in the event log i see this: MSCRM Platform Error Report -------------------------------------------------------------------------------------------------------- Error: <description>An unexpected error occurred.</description><details>An error occurred attempting to dispatch the email : HTTP status: 401 Access Denied.</details><file>D:\crm\Build\3297\src\platform\include\proxy\proxyutil.h</file><line>47</line> Error Message: An unexpecte...

Microsoft Office Keyboard Problems
Last month my hard drive failed. I have replaced it with another Maxtor but since reinstalling my software I cannot get my Microsoft Keyboard to work properly. It is okay for typing but any of the special keys (scroll, cut, paste, copy, open various apps) will not work. I have no idea what the problem is but I did reformat the hard drive with the Drive Genius program. I have tried reinstalling the latest intellitype software but still no results and microsoft has not been very helpful. The mactopia site states that this should work with my OS and G4. I am using Tiger. Any ideas? Brian M...

problem sending
a client is having problems sending email from outlook. Some of the replies she sends out, when received, are missing text and instead is a line like this: << File: ATT00005.txt; charset = Windows-1252 >> What's causing this behavior, and how is it remedied? For example, she copied some text from an email I sent to her into outlook and then added some of her own plain text, and I received the plain text part, but instead of what she copied, I also received a line like that above. Thanks. -- Bill ...

Activity linked to Opportunity security problem
We have a strong security requirement that activities created from an opportunity should not be visible to other user in the same OU except a sales Team. We also want other activities link to accounts and contacts to be visible to all users in the OU. The problem is that users how don't have access to the opportunity is still able to view the related activities and if the try to open the opportunity from the activity record they get access denied. Is this by design? This will force use to implement a much deeper OU hierarchy and maintenance of the system will be harder. Is there any other...

User Access Problems
Hi- we just finished instaling CRM 1.2 on a SBS 2003, and are having problems with users being unable to perform the tasks assigned to them in their user roles. For example- the sales manager can create a lead, but cannot convert it to an opportunity, despite being able to do so in his role. Does anyone have advice/ been in a similar situation? Thanks in advance -Tom ...

CString is having problems concatenating
Hi, I am using the following code to concatenate some text to a string: CString strPathToLnk = "C:\somefile.pdf" strPathToLnk += ".lnk"; I would like to think that there is a .lnk extension to the end of the string, but I keep seeing this instead: "C:\somefile.pdf". I stepped though the strcore.cpp file, but it doesn't add the extra text to the end! What am I doing wrong here? Thanks. Jaime Rios wrote: >Hi, >I am using the following code to concatenate some text to a string: > >CString strPathToLnk = "C:\somefile.pdf" >strPathTo...

Problems MSXML 3.0
So, MSXML 3.0 doesn't support Schema XSD. But where I can find especification about this? thanks Eder *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! wrong newsgroup. this is for the .NET XML support. MSXML is in microsoft.public.xml "Eder de Oliveira" <eder@stela.ufsc.br> wrote in message news:eyb0gGC3DHA.1672@TK2MSFTNGP12.phx.gbl... > So, MSXML 3.0 doesn't support Schema XSD. But where I can find > especification about this? > > thanks > Eder > > > > *** Sent via...

Dcount
Id Name job passportNo Serial 1 a bsc 11212 1 2 c infant 11212 1 3 djfj infant 11212 1 4 asdsfad mang 15456 2 5 asdfdsf non 4564 3 From the above Query you see serial give the 3 first row the same number 1 because they are related to each other . again if you see serial no (ID 1 ) he take serial 1 and the second and third row take no 1 also �. What I want to tell you : If Job infant and passportno as same as previous give the current record...

Word Printing problem
A neighbor, without internet, has just started to have a problem with word not printing as shown. Documents show correctly in the "Print Layout" view, but in print-preview and in actual printing, they print as a column about 1.5 inches wide along the left hand margin. In page setup, the margins are set for 1.0 inches (both left and right) and page is setup as a standard letter size (8.9 x 11.0). The printer test page comes out just fine. This just started with all new documents and with older documents that used to print just fine. What should I look at to help he...

Strange Exchange 2k Problem
From: "Paul Landregan" <plandregan@hotmail.com> Subject: Strange Exchange 2000 Problem Date: 03 April 2004 13:57 I have been running Exchange 2k for a month now. I have 32 users in a classroom environment. A strange thing happened yesterday, I tried to add a new user in AD, as normal the wizard asked me to create a mail box. No Problem so far. If i go back in AD the emil that is normally filled in with a few senonds for the new user is always blank. If I force the default recipient policy to run to add in the SMTP address still the email address does not get filled in. Also t...

Auth SMTP
I am having a strange problem with my Exchange 2000 running on 2003 Server/AD. Auth smtp is configured, so remote users can relay from outside the office network via a second virtual SMTP server listening on port 587. STrangely, some users - all existing AD user accounts - cannot send mail through that connection, even though the authentication succeeds. After the command "mail from: $username" the mail server says: 454 5.7.3 Client does not have permission to Send As this sender. Connection closed by foreign host. When $username is an existing user. However, I have create...

dcount of unique values
Hi, Is there a way where I can get a list of distinct values for a column from a set of rows which is obtained by applying a set of filter parameters (basically equivalent of a select distinct in SQL)? I tried DCOUNT and it works to get the count of all values matching the filter parameters. But I couldn't seem to find a way to get a count of the distinct values in a column. Please note that I need this to be done automatically, i.e., if the data changes, this count has to change. And the data that I'm trying to do a distinct is dynamic, i.e., it has to obtained by applying a set of...

Problems with tooltips
I've got a property sheet modal dialog, and I've added tooltips to all the controls, using the CToolTipCtrl. Everything is working great, except combo boxes! I can't get the tooltip to display for a combo box. I suppose I could give AddTool a rect structure, rather than a pointer to the control, but I'm curious why its not working the way it is. Russ Dirks ...

Problem Money 200
Hi, i use Money 2000 from 7 years in Italian version. Microsoft in last year not release italian version. I try use money 2005 trial but i don't convert file. How can buy new version if don't recover my data? How can convert my data if possible? I don't think that Microsoft no permit to recover data, i think that no possible. How can solve my problem? Raffaele ...

Money 2005 OFX Bank Download Problem
I've scoured this listserve and am still not finding a solution to the problem. I use First Mid-Illinois Bank & Trust and I am no longer able to download their OFX data file into Money 2005. I get some sort of a "corrupted file" error message. I've deleted Temp Internet Files, rebooted the computer, etc. and nothing is working. Is there a fix to the program, or some sequence of commands I need to do to solve this? Could Symantec Anti-Virus also be causing this? Help! ...