Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have an evil gremlin hiding inside one of the forms in Access 2007

Status
Not open for further replies.

RII

Technical User
Oct 15, 2009
4
PA
The situation:
One form: "Direct Cost", containig 3 sub-forms: "Materials", "Machinery" and "Salary", with a price "Subtotal" field (format: currency) in each one of them. Each subform have also, a "Total" field (Text Box) in Form footer, setting to "Not visible" (the field, not the form footer) and with a Control Source: =Nz(Sum([Subtotal]),0). Each of this text boxes names are: "MaterialsTotal", "MachineryTotal" and "SalaryTotal"
In the parent form: "Direct Cost", have 3 text boxes with: Enable = No and Locked = Yes and Control Source =[Materials].[Form]![MaterialsTotal], the Control Source of the second text box =[Machinery].[Form]![MachineryTotal]and the Control Source of the third: =[Salary].[Form]![SalaryTotal]. Names of this 3 texboxes: "MaterialGTotal"; "MachineryGTotal" and "SalaryGTotal"
In the footer section of the "Direct Cost" form, have another textbox with Control Source = [MaterialGTotal] + [MachineryGTotal] + [SalaryGTotal]
And the name of this semi-final textobox is: "DirectCostTotal"
Until here, everything is working fine. The problem is that this Direct Cost form, with all subforms and objects inside is, in turn a subform of another form named: "Stage" which have a textbox with Control Source =[DirectCost].[Form]![DirectCostGTotal] and name: "StageTotal".
In this step I have two problems:
1.- When, in user mode, I change values in the price Subtotal field of the Material subform, the "MaterialGTotal" field of the Subform and the "DirectCostTotal" of the parent form show the changes immediately, but the "StageTotal" don't update the value.
And this is the second problem) if I hit the Refresh button, the "StageTotal" field change, but something strange is happening (and here is where I say I have an evil gremlin hiding inside of the form), the field show a value that represent the summa of ...only two of the subforms!: the first on the top: "Machinery" and the last one at the botton: "Salary" and and stays at that value, no matter hw many times I hit the refresh button again.
Only if I change to the next registry and then go back, the "StageTotal" field update correctly, but if I make a value change in the one of the subforms...all happen again and continue ignoring the middle subform "Materials" subtotal's value.

Any ideas?, Can someone help me catch this gremlin?
 
It sounds to me that you don't have everything updating that you want updating in the various events for your form.

for instance, for your #1, one field is updated when another is not. Check the Event Code, and see what's happening there. If no event code, then check the properties for each control, there may be formulas in some, but not in others... in that case, just add formulas to the field(s) which are currently missing formulas BUT SHOULD HAVE THEM.

Otherwise, for future reference, try laying out your question better. If you want better answers, ask better questions - give detail, write concisely when possible, and try a little formatting. Click the link "Process TGML" just below the text box where you enter a post to see what is available.

Of course, just adding in some "white space" always helps - just using your <Enter> or <Return> button would cover that, as well as the old Spacebar. [wink]

--

"If to err is human, then I must be some kind of human!" -Me
 
Thanks for your answer and your time.
I found after I made the post, that the whole design concept of my database was wrong and had to start from scratch.

I also want to thank you for the tip about Process TGML. As English is not my language and understand it better than I can write, I realized that my post was a mess. Sorry for that. The next time will be better.

Thanks again!
 
How are ya RII . . .

For the record ... [blue]ReCalc[/blue] is what you were after!

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top