Problem with a Continuous sub form (1 Viewer)

PicassoB

Novice
Local time
Today, 19:57
Joined
May 7, 2007
Messages
63
Could anyone help please with this problem, I have searched the forum but not found anything to help.
I have a system that has a Continuous sub form, (example attached) this is used to calculate various processes. The problem is I would like to have the Labour cost as a single field in the header, as this can be changed by various countries. But on changing this it only changes the first row and does not alter the other processes.
I need the saved processes and allow the operators just to input their own labour rate, can this be done? – is there a formula to do this as I have tried different methods. The system was designed in Access 2003 but is mainly used with 2007, would greatly appreciate any help with this
 

Attachments

  • Test.zip
    71.2 KB · Views: 82

missinglinq

AWF VIP
Local time
Today, 14:57
Joined
Jun 20, 2003
Messages
6,423
When you change the Value in the LabourRate Textbox, in the Header, you're only changing the LabourRate for the Current Record, not for all of the Records! If you change the Value in the LabourRate Textbox in the Header, then immediately click on the Command Button, it just so happens that the Current Record in the Subform is the first Record. If you changed the LaborRate, clicked into any other Record, then clicked the Command Button, that Record's LaborCost would be recalculated, instead of the first Record's.

Linq ;0)>
 

PicassoB

Novice
Local time
Today, 19:57
Joined
May 7, 2007
Messages
63
Thank you for looking at this and the response, maybe I didn't explain to well what I require. Basically when I change the labour rate I need this to cascade down all the records automatically so the operators in different countries only need to enter the labour rate and then click the calculate button. Is this possible?
 

bob fitz

AWF VIP
Local time
Today, 19:57
Joined
May 23, 2011
Messages
4,727
Try:
Code:
  Me.Dirty = False
  CurrentDb.Execute ("UPDATE ProcessData SET ProcessData.LabourRate =" & Me.LabourRate & " WHERE (((ProcessData.AuditNo)=" & Parent.[AuditNo] & "));")
  Me.Recalc
If you put these lines in the After Update event of the text box called "LabourRate" the user will not need to click the label "Calculate" label.
 

PicassoB

Novice
Local time
Today, 19:57
Joined
May 7, 2007
Messages
63
Many thanks Bob it works brilliant just as I required
Spent hours trying different ways and hoped some one would know a code to solve my problem
really appreciate you helping a novice with code
 

bob fitz

AWF VIP
Local time
Today, 19:57
Joined
May 23, 2011
Messages
4,727
You're welcome. Glad it worked for you.
Did you use the code in the after update event of the LabourRate textbox as I suggested?
 

PicassoB

Novice
Local time
Today, 19:57
Joined
May 7, 2007
Messages
63
yes just as you said, great
dare I ask if there is a way I can change the time field to minutes & seconds it is currently a number field /60 because if I use the standard time field I can only input up to 23min, my system would then be complete :eek:
 

missinglinq

AWF VIP
Local time
Today, 14:57
Joined
Jun 20, 2003
Messages
6,423
You could have two Fields, one for Minutes and one for Seconds, but they have to be Number Fields. Fields defined as Date/Time Fields are used to hold points in time, not elapsed time, which is what you're talking about, here. You'd have to redo your expressions for calculating your costs, based on the hourly rates.

Or you could use the single Field, if your users could enter 3.5 for 3 minutes and 30 seconds, etc. As professional comedians and musicians will tell you, it all depends on your 'audience!'

Linq ;0)>
 

PicassoB

Novice
Local time
Today, 19:57
Joined
May 7, 2007
Messages
63
Thanks for the help Missingling - the system is used in the lab as bench mark testing against competitors products and Min/Sec are important
will try the options and see if this will be acceptable
appreciate your help :)
 

Users who are viewing this thread

Top Bottom