Total, subform->form problem ....

Janjang

Registered User.
Local time
Today, 15:08
Joined
Oct 17, 2005
Messages
80
ok guys..
i dunno what exactly happen..i think i done it at right way..

ok..i create Main Form that contain 2 (material and workmanship) subforms. subfrom i create using wizard from query
then i use =Sum([TotalAmount]) at subform footer to calculate total price from selected part (i create workshop's part management system) n it works fine..for both subform..

but another prob here..
at Main Form that contain material n workmanship subform. i want to calculate Grand Price, where it from TotalAmount from each subform..
i create 2 dummy control (to hold TotalAmount from each subform,coz i think its hard to make sum for 2 TotalAmount), 1 for material n 1 for workmanship..
then i want to sum 2 dummy control into Grand Price box...
but when i use =MaterialSubform.[Form]!TotalAmount at dummy's ControlSource it failed.. show #name?..

y? am i missing sumting at my Main form or subform? plz help me..
i want to send attachment but my fileto big to send...

*(i hope u can understand, coz my english not good ^_^)
 
Double check that you've used correct names for your subform and the field in your footer that you are attempting to total.
 
Even though the wizard will default the names the same, the SubForm and the SubFormControl do *not* have to have the same name. You know you are looking at the SubFormControl when the data tab shows the Link Master/Child Fields. The name of the SubFormControl is on the *other* tab of the property sheet. Your syntax looks correct IF

=MaterialSubform.[Form]!TotalAmount - is in the form:

=SubFormControlName.Form!ControlNameOnTheSubForm

Keep playing with this string until you are able to get *anything* from the subform to display.
 
arh..my mistake... TotalAmount is name the control at subform footer. so at TotalAmount's ControlSource is =Sum([Total])

i tried replace MaterialSubform with ChildMaterial(control that hold MaterialSubform at Main Form), like this ChildMaterial.Form!TotalAmount at dummy txt box but it show #error

any suggestion?
thanks guys..i appreciate it..
 
#error is different than #name! You are making progress. What value is in the TotalAmount TextBox on the SubForm when you get the #error. A Null could give you that #error that using the Nz() function would cure.
 
thanks for fast replied..
i checked value at subform..yes, it had value...$33.50...
but when i open Main Form back it show #name!

i dunno what to do..
should i restart back from fresh? huh.. :o
 
What does this mean?
...when i open Main Form back...

Isn't Main Form open all the time?
 
oh..yeah..sorry..its open all time..i try check TotaAmount's value by opening subfrom the look back my Main Form...

can i send email to Rural? by attacted my DB...
 
OK, go ahead. Rural Guy at Wild Blue dot Net without the spaces.
 
For anyone following this thread, here is the resolution.

When I received the mdb, SubForms were not being used in the SubFormControls. Instead there was a DataSheet view of a query as the SourceObject of the SubFormControls which I didn't know you could do. The names of the SubFormControls was ChildMaterial and ChildWorkmanship. When the OP changed the ControlSource of the MaterialDummy TextBox to use the correct name for the SubFormControl and the results changed from #Name to #Error, it was because they were not using SubForms as the SourceObject of the SubFormControl. When I changed the SubFormControls to use the SubForms already available, the error went away.

The biggest thing I learned was that you can use queries in SubFormControls and completely fool me with the description. I'm wiser now and so are you.
 
thanks RuralGuy...
now i learned something new from u...
thanks a gain....
 

Users who are viewing this thread

Back
Top Bottom