Solved

Time Calculation

Posted on 2007-03-25
1
204 Views
Last Modified: 2010-04-30
Hi Experts,

I have a field called starttime that is formated h:mm AM/PM.  I have added a new field called putime and traveltime.  I want to be able to calculate the pickup time by deducting the minutes of traveltime and 60 mins from starttime.

I have tried the following code but get an error:

    Me.putime = timeAdd("h:mm AM/PM", -60 - trvtime.Text, starttime)


0
Comment
Question by:andrewl77
1 Comment
 
LVL 14

Accepted Solution

by:
raja_ind82 earned 125 total points
ID: 18787615
starttime = Format(Now(), "h:mm AM/PM")
finaltime = DateAdd("n", 20, starttime) ' add twenty minutes...
MsgBox starttime
MsgBox finaltime

Have a look at this for more details on DATEADD:
http://msdn2.microsoft.com/en-us/library/hcxe65wz.aspx

Regards,
M.Raja
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question