Recording/formatting values

  • Thread starter Thread starter Audrey
  • Start date Start date
A

Audrey

Hi,

This is a followup on a message posted yesterday - or
rather, I need more help.

I have a field holding a number of hours. John Vinson was
kind enough to give me a few tips. I'll be storing the
hours as minutes.

Right now, I can display the number of minutes as hours
using this:
[Duration] / 60 & Format([Duration] MOD 60; ":00")

It works when I use it in the "control source" of the
Properties, but of course if I do that I can't record a
new value to the database.

How should I approach this? Put VB code in an event? Once
I figure out how to convert 7:30 into 450, where should I
put the code to store this into the table?

Thanks again for helping out
 
Hi,
My NumberMinutes stored in the table is displayed
correctly on the form (ex: 450 is displayed as 07:30).
Also, on LostFocus, I calculate the new value (ex 07:35)
to be put back in the table (455).
Right now, I do this using a call to recordset. However,
it's not updating the right entry in the table. I know I
need something like a Seek, or a similar command, if this
is to work. Is there an easier way to do this, and if not,
what is the right syntax?
Thank you
 
Right now, I do this using a call to recordset. However,
it's not updating the right entry in the table. I know I
need something like a Seek, or a similar command, if this
is to work. Is there an easier way to do this, and if not,
what is the right syntax?
Thank you

Please post your code, or consider my suggestion in the other thread.
 
Back
Top