Here's my situation: this is an invoicing module. If work was done in Denver
a check box is checked. If check box is true then balance due is multiplied
by 10% which total is put into a textbox, MaterialCost, in invisible footer.
The subform is bound to a table called DenverTax. If data entry person
enters a check in check box and after all info for invoice is entered then
employee, hours and 10% of balance due is entered in a subform. The reason
it's designed this way is because there are comparatively few invoices on
which we pay the Denver tax. The data entry person doesn't have to enter
subform for most invoices and it doesn't seem that data entry should figure
the 10% either or have to go thru the invoices 2 times to get the info, thus
the separate file. I'd like to design subform so that only employee(a drop
down combo box) and hours be entered and material will be filled in from
MaterialCost from parent form. When invoices form is completed it appears to
be working. On the first continuous form of subform of every Denver invoice
the 10% of balancedue appears correctly as it also appears in the footer. So
when this was tested it looked like everything was working. But when I
looked at my table, DenverTax, the only record updated with material cost(or
10% of balance due) was the first record of subform from first Denver invoice
done in batch.
Marshall Barton said:
JIM wrote:
:
JIM wrote:
Hi, I'm using Access 2000. I printed Allen Browne's answer to Richard
Horne's sum function and tried to use it in my situation which is: I want to
multiply BalanceDue(a text box on main form) by 10% and put it in my subform.
I have a textbox in the footer of my main form:
name: MaterialCost
control source: =[BalanceDue]*0.1
format: Currency
and above part is working perfect.
Then in my subform I have a textbox:
name: DenverMaterial
control source: =[Invoices Form].[Form].[MaterialCost]
As soon as it's saved it's converted to [Invoices Form].Form.MaterialCost
and displayed in field is"#Name?" Thanks
The syntax for a full reference would be:
=Forms![Invoices Form].[MaterialCost]
Or a shorter form of that for use in a subform:
=Parent.MaterialCost
The second suggestion with Parent.MaterialCost ,
seemingly, worked but couldn't get the first one to work
at all. On further checking my data though, only the first
record in a one to many relationship is updated with
MaterialCost. In other words, there is only one record in
subform file that is updated with MaterialCost even though
many records are created with other info that is typed in.
Some subforms have no input at all and a subform record
is not created so that might have some bearing.
You have completely lost me here. The expression we have
been discussing has nothing to do with saving any data to a
table.
I do not have enough information to fully understand your
one to many relationship. How a main form material cost can
relate to every record in the subform makes no sense to me.
Actually, this kind of calculated value should only rarely
be saved to a table and I just can't tell if this is one of
those rare cases.