S
scottyboyb
Greetings, a week or so ago I tagged a question onto another thread about a
DCount problem and I got an answer that I am having a problem with. I had to
go out of town and so I have left this for a while. Now I am back for a few
days and I am trying to make the answer work.
I have a form (testForm ased on one field from a table) and a subform
(testSubform based on a SQL statement). Here is the SQL:
SELECT ContributorsPledgesQuery.Name, ContributorsPledgesQuery.Campaign_ID,
ContributorsPledgesQuery.DatePledged, ContributorsPledgesQuery.AmountPledged,
ContributorsPledgesQuery.Paid, ContributorsPledgesQuery.PaymentDate
FROM ContributorsPledgesQuery;
The DCount needs to give me a count of records showing on the subform for
each record showing on the main form.
So here is what I have:
=DCount("[AmountPledged]","Pledges","[CampaignName] = '" &
[Forms]![testForm]![txtCampaignName] & "'")
=DCount("[field i am counting records of on subform]","table subform field
is in","[criteria field on main form] = '" & [Forms]![main form
name]![criteria fieldname on main form] & "'")
This gives me the total number of records in the Pledges table, not the
number of records showing on the subform. Does anyone see what is wrong with
this?
Best,
Scott
DCount problem and I got an answer that I am having a problem with. I had to
go out of town and so I have left this for a while. Now I am back for a few
days and I am trying to make the answer work.
I have a form (testForm ased on one field from a table) and a subform
(testSubform based on a SQL statement). Here is the SQL:
SELECT ContributorsPledgesQuery.Name, ContributorsPledgesQuery.Campaign_ID,
ContributorsPledgesQuery.DatePledged, ContributorsPledgesQuery.AmountPledged,
ContributorsPledgesQuery.Paid, ContributorsPledgesQuery.PaymentDate
FROM ContributorsPledgesQuery;
The DCount needs to give me a count of records showing on the subform for
each record showing on the main form.
So here is what I have:
=DCount("[AmountPledged]","Pledges","[CampaignName] = '" &
[Forms]![testForm]![txtCampaignName] & "'")
=DCount("[field i am counting records of on subform]","table subform field
is in","[criteria field on main form] = '" & [Forms]![main form
name]![criteria fieldname on main form] & "'")
This gives me the total number of records in the Pledges table, not the
number of records showing on the subform. Does anyone see what is wrong with
this?
Best,
Scott