Using Access 2010, I would like to count all check amounts greater than $50 within a table. So far I’ve used the expression - = DCount("[ChkAmt]","tblChecks","txtChkAmt > 50")
, but this expression results in “#Error”. I believe I may have a problem with the “Domain” part of the syntax. The Objects and Controls I’m using are: tblChecks (a Table); ChkAmt ( a Field); and txtChkAmt (a Text Box). I would appreciate any assistance with my issue. Thanks in advance.
As far as I know, NO brackets are necessary in DCount function: - =DCount("ChkAmt","tblChecks","ChkAmt>50")
7 1103
Use the field in your database, not the control in your form.
Hi Rabbit! Thanks for responding. I modified the expression to - =DCount("[ChkAmt]","tblChecks","[ChkAmt]>50")
and - =DCount("[ChkAmt]","tblChecks","[ChkAmt]">"50")
. In both instances the result was #Error. Does the solution have anything to do with whether or not I'm using brackets and quotes appropriately?.
I would have responded sooner, but was searching the site for issues the same as or similar to mine.
You have an extra double quote that popped out of nowhere. It wasn't in your original code.
I was experimenting with different bracket and quote positions, but none of my combinations appear to work. Here's the last failed attempt: - =DCount("[ChkAmt]","tblChecks","[ChkAmt]>50")
As far as I know, NO brackets are necessary in DCount function: - =DCount("ChkAmt","tblChecks","ChkAmt>50")
Again, as far as I know, this structure is available for all D functions.
You're absolutely correct, Mihail, brackets are necessary when numbers, spaces, or some other character is used in Object and Control names.
When you included the expression I sent I could clearly see my mistake. A small, but critical one at that. Are you ready? The domain is "tblCheck" not "tblChecks".
There you are...problem resolved. Much thanks goes out to you and "Hats Off" to Rabbit as well. You guys are Great!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Dave |
last post by:
I have a form which is based on a table (a) with over 6000 records.I have a
button on this form which will open another form with related data from
another table (b). What I want to do is open the...
|
by: RC |
last post by:
My code below will loop through all the records in the table, and when
the if statement is true it goes to the
***Me.ContainerNumberProductsTable = GETContainerNumber.Value*** bit
like should but...
|
by: Larry Rekow |
last post by:
As part of a macro, I'm trying to automate appending a table with new
records.
let's say the table 2 has some new records in it, but also has a lot
of identical records to table 1.
I would...
|
by: jean.ockert |
last post by:
Greetings.
Access version 2003 on an XP system
I am using the template "Event Management" database as the primary
database and need additional functionality added. I have a dance
studio. ...
|
by: Stinky Pete |
last post by:
Hi,
In order to keep the file that's in development up to date with the
reference (and still used) file, I need to regularly import the
original main table and then physically select and append...
|
by: kevinjbowman |
last post by:
I am by no means a SQl Jedi as will be apparent by my question, but I
can usually figure out a select statement on my own. I have one today
though that really has me stumped. I am working in...
|
by: Viktor |
last post by:
I have a problem with counting empty fields in table.
For example: I have the field in which i coulld write several solutions.
"done", "not done", "send", "not send" etc.
In report i want to...
|
by: mim77 |
last post by:
Hi,
I'm very rusty with Access programming. I hope someone can help me. I'm trying to include a count of the number of specific records in a field. Values for the records in the field are either...
|
by: Okonita via DBMonster.com |
last post by:
Hi all,
Working on a little shell script to remove specific records from a flat file.
I have scanned a one or two script books and googled for answers but have no
success. Can someone show me how...
|
by: KPR1977 |
last post by:
Below is a very handy function that transposes fields from "Table1" into "Table2". Note, in Table1 the Field2, Field3, etc represent Option codes.
Basically it takes this...
Table1
ProdBreakDown...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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,...
| |