Adding 10 min to a stored time

213emi

New Member
Joined
Apr 9, 2010
Messages
7
This is a little more frustrating than i thought it would be.
What i'm trying to do is just add an arbitrary 10 min to an already existing time.

The scenario: Scheduling
A student is partaking in various activities throught the day
They can do multiple events in one day but a 10 min must be added on the end of each event to account for the 'walking' time to the next event.
Each activity is 15 min long.
Another student may start the activity while the first student is in the walking time so i can't just make the activity times 25 min.

I have tried just adding the 10 min all sorts of ways but nothing works.
Is there some special format i need to put the 10 min in so its the same as the time i'm adding it to?

I am taking my first database class so i only have a basic understanding of access and vba. Anything will help though.
Ty for your time
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I usually use the Time function to add distinct intervals.
For example, Time(0,10,0) is 10 minutes; Time(10,0,0) is 10 hours; Time(0,0,10) is 10 seconds.

Denis
 
Upvote 0
Look up DateAdd.

Code:
DateAdd("n",10,Now())

Instead of Now() you would substitute your time value.

hth,

Rich
 
Upvote 0
Now i'm having some trouble with the actual update
It has like a delay. Whenever i update it it changes to the one i had before
and it won't change to the new one until i update it again

Code:
Private Sub ComboHour_Change()
'----------------------- update the 10 min and 15 min textboxes -------------------
If IsNull(TimeBox) Then
Else
Me.Text10min.Value = DateAdd("n", -10, TimeBox)
Me.Text15min.Value = DateAdd("n", 15, TimeBox)
End If
Me.TimeBox.Value = DLookup("[TimeQ]", "Query_Time_Reserve")
Me.Refresh
End Sub
 
Upvote 0
Try the afterupdate event. The change event fires after each keypress (I believe) and is strange.

hth,

Rich
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top