If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Still struggling with DCount
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 |
#2
|
|||
|
|||
Still struggling with DCount
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" wrote: 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 |
#3
|
|||
|
|||
Still struggling with DCount
On Fri, 6 Nov 2009 07:20:02 -0800, scottyboyb
wrote: 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). -- John W. Vinson [MVP] |
#4
|
|||
|
|||
Still struggling with DCount
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" wrote: 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" wrote: 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 |
#5
|
|||
|
|||
Still struggling with DCount
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" wrote in message ... 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" wrote: 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" wrote: 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 |
#6
|
|||
|
|||
Still struggling with DCount
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" wrote: 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" wrote: 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" wrote: 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 |
#7
|
|||
|
|||
Still struggling with DCount
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" wrote: 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" wrote: 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" wrote: 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" wrote: 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 |
#8
|
|||
|
|||
Still struggling with DCount
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" wrote: 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" wrote: 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" wrote: 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" wrote: 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" wrote: 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 |
#9
|
|||
|
|||
Still struggling with DCount
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" wrote: 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" wrote: 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" wrote: 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" wrote: 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" wrote: 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" wrote: 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 |
#10
|
|||
|
|||
Still struggling with DCount
On Sat, 7 Nov 2009 13:29:01 -0800, scottyboyb
wrote: 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. Post the SQL of the query. Is AmountPledged in fact in the query? If you open the query itself in datasheet view, does it have a Paid field, an AmountPledged field, and the records you expect? And do you want to *count records* (in which case the AmountPledged would appear to be irrelevant), or *sum pledges* (in which case DSum() would be the appropriate function)? -- John W. Vinson [MVP] |
|
Thread Tools | |
Display Modes | |
|
|