Calculated fields in Access

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

I have two fields in an Access data base which has a form.

I'd like to run a calculation on two of the fields and
have the results show in a third on the form and without
having to run a query.

The two fields that have input data are StartTime and
EndTime. The third Filed should have Duration in Hrs:Mins.
I have tried entering =[endtime]-[starttime] in the
desired results field entering and I entered formula in
validation rule. I get no error message but when times are
input in both StartTime and EndTime the Duration filed is
blank.

Any help you can give would be greatly appreciated.
 
Michael,

You need to opout he formula in the ControlSource property of the Duration
Field. The ValidationRule is to validate the data being entered and has no
effect on a calculated control.

HTH,
Josh
 
The default result of VB of [endtime]-[starttime] is the number of day. you
have to format it by using Format function. try NZ function.
 
Back
Top