Include two parts of a record in code

G

Guest

Me.TaskID = 57 And Me.TimeSeconds = Me.txtJimBob * 0.1 * 60

This does not seem to work so how can I write this statement to have TaskID
record number 57's TimeSeconds field equal the expression Me.txtJimBob * 0.1
* 60?

Thanks,

Dennis
 
J

John Vinson

Me.TaskID = 57 And Me.TimeSeconds = Me.txtJimBob * 0.1 * 60

This does not seem to work so how can I write this statement to have TaskID
record number 57's TimeSeconds field equal the expression Me.txtJimBob * 0.1
* 60?

Thanks,

Dennis

Ummm... use two statements.

Me.TaskID = 57
Me.TimeSeconds = Me.txtJimBob * 6


There's no need to make Access multiply 0.1 by 60 again and again...

What's the context? Where are you putting this expression?

John W. Vinson[MVP]
 
G

Guest

This will be used and applied to only one record. Record "57" When record
"57" occurs based on the user checking the check box for this record, the
calculation Me.txtJimBob * 0.1 * 60 (which txtJimBob is a total of jobs
produced say 600 multiplied by .1 which is 10 percent of 600, "60" jobs
mulitplied by the 60 seconds it takes to perform the inpection of 10% of the
work produced) will then be applied. In my data base, I add up all of the
seconds of the different types of daily tasks and divide by 28800 to estimate
how many employees I should need to produce the projected work.

Most of the duties I am calculating are fixed average times but some have
variables like the number of jobs produced and that changes based on the
forcast. My plan for this code is to put it in the form's records check box
After Update Event. When I check record "57" to include that task in the
total calculation, the code will be called to make the calculation. Using it
like this, will it calculate again and again...?

--
Thanks,

Dennis
 
J

John Vinson

This will be used and applied to only one record. Record "57" When record
"57" occurs based on the user checking the check box for this record, the
calculation Me.txtJimBob * 0.1 * 60 (which txtJimBob is a total of jobs
produced say 600 multiplied by .1 which is 10 percent of 600, "60" jobs
mulitplied by the 60 seconds it takes to perform the inpection of 10% of the
work produced) will then be applied. In my data base, I add up all of the
seconds of the different types of daily tasks and divide by 28800 to estimate
how many employees I should need to produce the projected work.

Most of the duties I am calculating are fixed average times but some have
variables like the number of jobs produced and that changes based on the
forcast. My plan for this code is to put it in the form's records check box
After Update Event. When I check record "57" to include that task in the
total calculation, the code will be called to make the calculation. Using it
like this, will it calculate again and again...?

I'm really not visualizing your structure here. What's stored in your
tables? What determines which calculations are variable and which are
constant? For the constant ones, can you perhaps use a variable which
always keeps the same value, so you only need one expression?

Don't worry about calculations being done again and again. Computers
are DESIGNED to do calculations again and again; an expression like
this is *much* faster than retrieving data from disk. Just do the
calculation in a Query and use the query as the recordsource for your
Form (for onscreen display) or Report (for printing).

John W. Vinson[MVP]
 

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

Top