Re: dcount expression on subform
- From: "Rick Brandt" <rickbrandt2@xxxxxxxxxxx>
- Date: Sun, 26 Nov 2006 03:01:46 GMT
"JohnE" <JohnE@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A41AB00F-F24F-423C-8CB3-7287C8A74D9B@xxxxxxxxxxxxxxxx
I have a main form that has 2 subforms on it. On SubA (source object is
frmClaimProvision) there is a textbox that is to display the the number of
associated comments there are in SubB (source object is
frmClaimProvisionComment). Both subforms are in continuous style. The way
this works is that SubA is the many to the mainform one, while SubB is the
many to the SubA one. ProvisionID is the PK of tblClaimProvision and the FK
of tblClaimProvisionComment. Here is the expression that is the textbox
control source.
=DCount("ProvisionID","tblClaimProvisionComment",[ProvisionID]=[Forms]![frmClaimProvision]![ProvisionID])
This is not working and I am lost on what is missing or how to proceed from
here so I seek assistance. Can anyone help? Thanks in advance for
responding.
Subforms are not technically "open" and are not found in the Forms Collection.
You have to reference them via the main form and subform control object.
=DCount("ProvisionID","tblClaimProvisionComment",[ProvisionID]=[Forms]!ParentFormName!SubA.Form![ProvisionID])
Note that the name of the subform source object is not used at all. What you
refer to is the Form property of the Subform Control
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
.
- Prev by Date: Re: Moving Info
- Next by Date: Re: dcount expression on subform
- Previous by thread: can't see new records on sub form
- Next by thread: Re: dcount expression on subform
- Index(es):
Relevant Pages
|