Calculating speed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form on which I want to create a text box with a formula for
calculating speed in Yds per Min.
Just to test things out, I have already created text boxes in my form with
formulas to convert miles to yds - =[Distance in Miles]*1760 - and calculate
start/stop time in mins - =(DateDiff("n",[Release Time],[1st Bird Time])).

So both of these return the values I want. (yards and minutes respectively)

Now - how can I create a formula using the formulae above to give me a text
box value which calculates yds/min

By the way - you guys do a brilliant job in answering all of these questions
so thanks for that. Wouldn't know where to go without you all.
 
Great - That works just fine.
Now - the answer comes back to 12 decimal places. How do I change it to 2
places. I have tried changing the text box format to 'general number' and 2
decimal places, but it makes no difference.

Thanks





Allen Browne said:
=[Distance in Miles] * 1760 / DateDiff("n", [Release Time], [1st Bird Time])

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.
RC said:
I have a form on which I want to create a text box with a formula for
calculating speed in Yds per Min.
Just to test things out, I have already created text boxes in my form with
formulas to convert miles to yds - =[Distance in Miles]*1760 - and
calculate
start/stop time in mins - =(DateDiff("n",[Release Time],[1st Bird Time])).

So both of these return the values I want. (yards and minutes
respectively)

Now - how can I create a formula using the formulae above to give me a
text
box value which calculates yds/min

By the way - you guys do a brilliant job in answering all of these
questions
so thanks for that. Wouldn't know where to go without you all.
 
Try Fixed, and 2 decimal places.

I think that would be better than:
=Round([Distance in Miles] * 1760 / DateDiff("n", [Release Time], [1st Bird
Time]),2)

BTW, you can divide one text box by another in your form, e.g.:
=[txtDistance] / [txtMinutes]

And sometimes you need to typecast the result of the calcuation so Access
understands the intended data type. Details in:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

RC said:
Great - That works just fine.
Now - the answer comes back to 12 decimal places. How do I change it to 2
places. I have tried changing the text box format to 'general number' and
2
decimal places, but it makes no difference.

Thanks

Allen Browne said:
=[Distance in Miles] * 1760 / DateDiff("n", [Release Time], [1st Bird
Time])

RC said:
I have a form on which I want to create a text box with a formula for
calculating speed in Yds per Min.
Just to test things out, I have already created text boxes in my form
with
formulas to convert miles to yds - =[Distance in Miles]*1760 - and
calculate
start/stop time in mins - =(DateDiff("n",[Release Time],[1st Bird
Time])).

So both of these return the values I want. (yards and minutes
respectively)

Now - how can I create a formula using the formulae above to give me a
text
box value which calculates yds/min

By the way - you guys do a brilliant job in answering all of these
questions
so thanks for that. Wouldn't know where to go without you all.
 
Back
Top