PROBLEM: Subform total on main form returns #Name

  • Thread starter Thread starter cagie_78
  • Start date Start date
C

cagie_78

Hi all,

I've read through a thousand posts concerning this topic, but can't get
it to work.
I'm trying to get a subform total onto my main form with following
details:

SUBFORM:
I managed to get the total of column 'M15' in the subform footer:

Subform Name: FRM - Daily Volumes Data
Textbox Name: Sum_M15
Textbox Control Source: =Sum([M15])

So far, so good.

MAIN FORM:
I have a main form called 'FRM - Daily Volumes', which is an unbound
form.

In the form header, I have 4 unbound combo-boxes, which enable me to
filter the subform.

In the detail section, I have the subform FRM - Daily Volumes Data,
which is linked to the combo-boxes via child & master fields. The Name
& Source Object of the subform both is 'FRM - Daily Volumes Data'.

So far, so good. Filtering is ok ... records returned are ok.

In the footer of the main form however, I want to return my subform
total.
I've created a Textbox with:
Name: Total_M15
Control Source: =[FRM - Daily Volumes Data].[Form]![Sum_M15]

......... this returns #Name

What am I missing???

Thx,
Cagie
 
Cagie,
The "syntax" of your reference is OK, but you must have a mispelled an object Name in
there somewhere. Usually it's the subform Name.
You may have used [FRM - Daily Volumes Data] as the SourceObject, but "named" it
something like FRM Daily Volumes Data. (just a slight difference in the spelling). Check
the Name for each object as opposed to the SourceObject.

On the main, an unbound text control with...
=Forms!frmMainformName!frmSubformName.Form!FieldName
or
=frmSubformName.Form!FieldName
would display the FieldName value.

Minor point: Try not to use spaces and special characters in your naming conventions.
That way, you don't have to bracket.
Ex. frmDailyVolumesData.
 
well, assuming that you've verified that the name of the subform *control*
(within the main form) is indeed [FRM - Daily Volumes Data], then the syntax
of the expression looks correct to me. though the brackets *should* take
care of the spaces and special character in the subform control name,
suggest you try changing the name of the subform control to the recommended
format anyway - that is, remove the spaces and special character, as

FRMDailyVolumesData

hth
 
Thx for the advice guys. I've tried it ...but no change.

Could it be because the subform is based on a query, rather than a
table?

I have another form/subform combination exactly like this and
everything is the same (as far as I can see), except for the fact that
the subform - in that case - is a table.

In this new form/subform combination, I've based the subform on a
select query.
Do I need to requery something perhaps?

Greetz,
Cagie.
 
basing the subform on a query rather than a table should have no effect.
it's possible that the form and/or subform is corrupted. suggest you try
rebuilding it - just the basics needed for it to run - to see if it will
run; if so, then finish the rebuild with whatever "spit 'n polish" you want
to give it. also, if you're running A2000 or later, and if the Name
Autocorrect option is *not* turned off, suggest you start by creating a new
blank database, immediately turning OFF the Name AutoCorrect option (Tools |
Options | General tab, on the menu bar), compacting the db, importing all
your objects *except* the forms in question. then do the bare-bones rebuild,
test, and finish the rebuild.

hth
 
I rebuilt the form with exactly the same input, like you suggested.
For some reason, it works now. Must have been corrupted, coz the code
was ok.

Strange how a form can get corrupted...

Thx,
Cagie
 

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

Back
Top