Solved

Time Calculation

Posted on 2007-03-25
1
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

628 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