Re: DSUM not working for subdataform
- From: "Jeff Boyce" <JeffBoyce_IF@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 25 Nov 2006 06:02:18 -0800
Phil
What is the data type for the underlying "Policy" fields? Where are the
quotes around the criteria (see Access HELP for correct syntax)?
It isn't clear how you are trying to use the DSum() - why are you using two
tables for your criteria?
If you have a main-form ("policy") and a subform ("aircraft"), you probably
wouldn't want to have the total cost of EVERY policy's aircraft when you are
only displaying a single policy, right? Instead of connecting table1 and
table2 via your criteria, try something like:
... "Table2!Policy = " & Me!YourPolicyField ...
to have the DSum() refer to the field on the form holding the current
policy -- and the syntax will vary, depending on data type.
--
Regards
Jeff Boyce
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
Microsoft Registered Partner
https://partner.microsoft.com/
"Phil Davy" <PhilDavy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B2EFD1D4-0EF7-4580-8191-93BCF16D7E0A@xxxxxxxxxxxxxxxx
Hi all,a
I have a table of policies (Table1) and a table of aircraft (Table2) with
one to many mapping which I've specified using a subdata*** andequivalent
form. I.e. one policy can have one or many aircraft.for
In my policy form, I'm trying to show the total cost of all the aircraft
that policy.fashion)
My syntax is therefore
=DSum("[Cost]","[Table2]",[Table1!Policy]=[Table2!Policy])
but I just keep getting #NAME! It works (incorrectly) if I remove the
criteria.
As you might imagine, the MS help is next to useless as (in classic
it only gives the most basic example where the criteria is fixed.
Any help will be much appreciated!
Thanks
.
- Follow-Ups:
- Re: DSUM not working for subdataform
- From: Phil Davy
- Re: DSUM not working for subdataform
- Prev by Date: Re: Address book
- Next by Date: Re: Fancy Tooltips and .visible=false
- Previous by thread: Address book
- Next by thread: Re: DSUM not working for subdataform
- Index(es):