Get a Time Calculation to Run

G

Guest

Access 2000 - I am new to programming in Access. I need to return an amount of time calculated on the starttime and endtime on a form based on a table. The first field is StartTime, the second field is EndTime, both formated to MedTime. The third field is Minutes formated to ShortTime. I put a function in the Minutes contol OnEnter property as follows: =Format([StartTime] -1 -[EndTime], "Short Time"). I typed 1:00 in StartTime, tabbed and put 1:05 in EndTime, tabbed to Minutes and nothing happens. What am I doing wrong

Thank you
 
G

Guest

I would try this

1) don't make the minutes field a specific type (short time

2) in the minutes Got Focus event type the following code
minutes.Value = DateDiff("n", [starttime], [endtime]

This worked fine for me....with StartTime and EndTime being mediumtime fields. With a Starttime of 5:00pm and EndTime being 5:05pm the minutes box calculated as
 

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