Still struggling with DCount

S

scottyboyb

I am still strugling with understanding DCount. I don't know why I can't get
it.

Does DCount work in forms and subforms? If so, what is wrong with this:

DCount("[AmoutPledged]","Forms![Campaign Pledge Listing
Subform]","[AmountPledged] >'0' ")

AmountPledged = currency field in table
Campaign Pledge Listing Subform = subform that holds AmountPledged

As I understand it, DCount says to count the records in the field xxx in the
table or query or form xxx where field xxx meets this criteria. In this case
the field AmountPledged in the subform Campaign Pledge Listing Subform where
AmountPledged > 0.

Many thanks,
Scott
 
R

RonaldoOneNil

DCount does not work with forms, only Tables and Queries. A form's
recordsource is also a table or query so you do not need it to apply to
forms, you can use the underlying table or query.

DCount("[A Field in Table or Query]","[Query or Table
Name]","]","[AmountPledged] >0")
 
J

John W. Vinson

I am still strugling with understanding DCount. I don't know why I can't get
it.

Does DCount work in forms and subforms? If so, what is wrong with this:

DCount("[AmoutPledged]","Forms![Campaign Pledge Listing
Subform]","[AmountPledged] >'0' ")

AmountPledged = currency field in table
Campaign Pledge Listing Subform = subform that holds AmountPledged

As I understand it, DCount says to count the records in the field xxx in the
table or query or form xxx where field xxx meets this criteria. In this case
the field AmountPledged in the subform Campaign Pledge Listing Subform where
AmountPledged > 0.

Many thanks,
Scott

Data is not stored in Forms.

The domain functions (such as DLookup and DCount) retrieve data from Tables or
Queries. They do not retrive data from Forms. The second argument of the
function must be the name of either a Table or a Query.

Use the query that is the recordsource of the Subform; you may need an
additional criterion if you want to retrieve a particular member's
contributions (I don't know the structure of your form or tables so I can't
specify what that would be).
 
S

scottyboyb

Thanks for the reply. I appreciate the explanation. I have put your solution
in and I am geting a name error. I have checked all thenales and they appear
correct. Is there someplace I should be looking?

Best,
Scott


RonaldoOneNil said:
DCount does not work with forms, only Tables and Queries. A form's
recordsource is also a table or query so you do not need it to apply to
forms, you can use the underlying table or query.

DCount("[A Field in Table or Query]","[Query or Table
Name]","]","[AmountPledged] >0")

scottyboyb said:
I am still strugling with understanding DCount. I don't know why I can't get
it.

Does DCount work in forms and subforms? If so, what is wrong with this:

DCount("[AmoutPledged]","Forms![Campaign Pledge Listing
Subform]","[AmountPledged] >'0' ")

AmountPledged = currency field in table
Campaign Pledge Listing Subform = subform that holds AmountPledged

As I understand it, DCount says to count the records in the field xxx in the
table or query or form xxx where field xxx meets this criteria. In this case
the field AmountPledged in the subform Campaign Pledge Listing Subform where
AmountPledged > 0.

Many thanks,
Scott
 
G

Gina Whipp

Scott,

Copy/paste your new DCount here along where you are using it.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

scottyboyb said:
Thanks for the reply. I appreciate the explanation. I have put your
solution
in and I am geting a name error. I have checked all thenales and they
appear
correct. Is there someplace I should be looking?

Best,
Scott


RonaldoOneNil said:
DCount does not work with forms, only Tables and Queries. A form's
recordsource is also a table or query so you do not need it to apply to
forms, you can use the underlying table or query.

DCount("[A Field in Table or Query]","[Query or Table
Name]","]","[AmountPledged] >0")

scottyboyb said:
I am still strugling with understanding DCount. I don't know why I
can't get
it.

Does DCount work in forms and subforms? If so, what is wrong with this:

DCount("[AmoutPledged]","Forms![Campaign Pledge Listing
Subform]","[AmountPledged] >'0' ")

AmountPledged = currency field in table
Campaign Pledge Listing Subform = subform that holds AmountPledged

As I understand it, DCount says to count the records in the field xxx
in the
table or query or form xxx where field xxx meets this criteria. In this
case
the field AmountPledged in the subform Campaign Pledge Listing Subform
where
AmountPledged > 0.

Many thanks,
Scott
 
B

Beetle

Can you post your DCount statement as it currently is?

There is an extra bracket in the example from the other
responder which you may have unknowingly placed in
yours as well.
--
_________

Sean Bailey


scottyboyb said:
Thanks for the reply. I appreciate the explanation. I have put your solution
in and I am geting a name error. I have checked all thenales and they appear
correct. Is there someplace I should be looking?

Best,
Scott


RonaldoOneNil said:
DCount does not work with forms, only Tables and Queries. A form's
recordsource is also a table or query so you do not need it to apply to
forms, you can use the underlying table or query.

DCount("[A Field in Table or Query]","[Query or Table
Name]","]","[AmountPledged] >0")

scottyboyb said:
I am still strugling with understanding DCount. I don't know why I can't get
it.

Does DCount work in forms and subforms? If so, what is wrong with this:

DCount("[AmoutPledged]","Forms![Campaign Pledge Listing
Subform]","[AmountPledged] >'0' ")

AmountPledged = currency field in table
Campaign Pledge Listing Subform = subform that holds AmountPledged

As I understand it, DCount says to count the records in the field xxx in the
table or query or form xxx where field xxx meets this criteria. In this case
the field AmountPledged in the subform Campaign Pledge Listing Subform where
AmountPledged > 0.

Many thanks,
Scott
 
S

scottyboyb

Greetings,

DCount("[AmountPledged]","[ContributorsPledgesQuery]","[Paid]=True")

I did see the extra brackets. Here is the statement as it is now.

AmountPledged is a number field. Then the query named above for Paid, a
yes/no field in the same query and field that I want to be counted for true.

Thanks,
Scott


Beetle said:
Can you post your DCount statement as it currently is?

There is an extra bracket in the example from the other
responder which you may have unknowingly placed in
yours as well.
--
_________

Sean Bailey


scottyboyb said:
Thanks for the reply. I appreciate the explanation. I have put your solution
in and I am geting a name error. I have checked all thenales and they appear
correct. Is there someplace I should be looking?

Best,
Scott


RonaldoOneNil said:
DCount does not work with forms, only Tables and Queries. A form's
recordsource is also a table or query so you do not need it to apply to
forms, you can use the underlying table or query.

DCount("[A Field in Table or Query]","[Query or Table
Name]","]","[AmountPledged] >0")

:

I am still strugling with understanding DCount. I don't know why I can't get
it.

Does DCount work in forms and subforms? If so, what is wrong with this:

DCount("[AmoutPledged]","Forms![Campaign Pledge Listing
Subform]","[AmountPledged] >'0' ")

AmountPledged = currency field in table
Campaign Pledge Listing Subform = subform that holds AmountPledged

As I understand it, DCount says to count the records in the field xxx in the
table or query or form xxx where field xxx meets this criteria. In this case
the field AmountPledged in the subform Campaign Pledge Listing Subform where
AmountPledged > 0.

Many thanks,
Scott
 
B

Beetle

I don't immediately see anything wrong with the way that
is written. Are you putting this directly in the Control Source
of a text box on your form? If so you need to precede it
with the = sign.

=DCount("[AmountPledged]","[ContributorsPledgesQuery]","[Paid]=True")
--
_________

Sean Bailey


scottyboyb said:
Greetings,

DCount("[AmountPledged]","[ContributorsPledgesQuery]","[Paid]=True")

I did see the extra brackets. Here is the statement as it is now.

AmountPledged is a number field. Then the query named above for Paid, a
yes/no field in the same query and field that I want to be counted for true.

Thanks,
Scott


Beetle said:
Can you post your DCount statement as it currently is?

There is an extra bracket in the example from the other
responder which you may have unknowingly placed in
yours as well.
--
_________

Sean Bailey


scottyboyb said:
Thanks for the reply. I appreciate the explanation. I have put your solution
in and I am geting a name error. I have checked all thenales and they appear
correct. Is there someplace I should be looking?

Best,
Scott


:

DCount does not work with forms, only Tables and Queries. A form's
recordsource is also a table or query so you do not need it to apply to
forms, you can use the underlying table or query.

DCount("[A Field in Table or Query]","[Query or Table
Name]","]","[AmountPledged] >0")

:

I am still strugling with understanding DCount. I don't know why I can't get
it.

Does DCount work in forms and subforms? If so, what is wrong with this:

DCount("[AmoutPledged]","Forms![Campaign Pledge Listing
Subform]","[AmountPledged] >'0' ")

AmountPledged = currency field in table
Campaign Pledge Listing Subform = subform that holds AmountPledged

As I understand it, DCount says to count the records in the field xxx in the
table or query or form xxx where field xxx meets this criteria. In this case
the field AmountPledged in the subform Campaign Pledge Listing Subform where
AmountPledged > 0.

Many thanks,
Scott
 
S

scottyboyb

I put the = sign in and now I ger a #error. DCount seems to have me on the
ropes. I have rechecked the spelling of each field and query and everything
seems fine.

I mayjsut give up and not provide this info on the form. Iti is the reports,
but I was hoping to have it on the forms where pople are working.

Best,
Scott

Beetle said:
I don't immediately see anything wrong with the way that
is written. Are you putting this directly in the Control Source
of a text box on your form? If so you need to precede it
with the = sign.

=DCount("[AmountPledged]","[ContributorsPledgesQuery]","[Paid]=True")
--
_________

Sean Bailey


scottyboyb said:
Greetings,

DCount("[AmountPledged]","[ContributorsPledgesQuery]","[Paid]=True")

I did see the extra brackets. Here is the statement as it is now.

AmountPledged is a number field. Then the query named above for Paid, a
yes/no field in the same query and field that I want to be counted for true.

Thanks,
Scott


Beetle said:
Can you post your DCount statement as it currently is?

There is an extra bracket in the example from the other
responder which you may have unknowingly placed in
yours as well.
--
_________

Sean Bailey


:

Thanks for the reply. I appreciate the explanation. I have put your solution
in and I am geting a name error. I have checked all thenales and they appear
correct. Is there someplace I should be looking?

Best,
Scott


:

DCount does not work with forms, only Tables and Queries. A form's
recordsource is also a table or query so you do not need it to apply to
forms, you can use the underlying table or query.

DCount("[A Field in Table or Query]","[Query or Table
Name]","]","[AmountPledged] >0")

:

I am still strugling with understanding DCount. I don't know why I can't get
it.

Does DCount work in forms and subforms? If so, what is wrong with this:

DCount("[AmoutPledged]","Forms![Campaign Pledge Listing
Subform]","[AmountPledged] >'0' ")

AmountPledged = currency field in table
Campaign Pledge Listing Subform = subform that holds AmountPledged

As I understand it, DCount says to count the records in the field xxx in the
table or query or form xxx where field xxx meets this criteria. In this case
the field AmountPledged in the subform Campaign Pledge Listing Subform where
AmountPledged > 0.

Many thanks,
Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top