Balfour211 said:
I really appreciate your help with this. Your suggestions will help,
except
they are just over my head as far as abilities go. I have worked with
Formatting codes before, but nothing as involved as this one:
format(hour(time) + (minute(time) / 60),"00.00"). I have looked through
the
help files, and can't find anything similar to it. The field that I need
formatted is named "Total_Time". Could you show me where it fits in your
line of code?
You just use my function in a expression in a report...
So, for example, in a report, you create a new text box, you then use for
the expression
=(nHours([Total_Time]))
You can also use the above in a query, or even on a form (however, function
expressions on a form are NOT updatable, so, this tip might not be of use on
a form if the displayed expression needs to be editable).
So, the sample code I posted would be placed in a standard code module (give
the module a name of module1 - that is the default when you create a module.
Paste in my sample code, and then make use you hit save....
At this point, anywhere, or anytime you need a formatted time value, you use
the nHours() function.
You could also in your reports, or wherever use the full expression, but
that is bit clumsy when you have to do this over and over. so, you could on
a report create a text box, and use the following expression (remember,
don't give the text box the same name as an existing field when you do
this).
= ( Format(Hour([Total_Time]) + (Minute([Total_Tiime]) / 60), "00.00") )
I made a function since the above expression is rather painful to have to
type into a report each time you need a formatted time value.