Start Time calculation

psamu

Active Member
Joined
Jan 3, 2007
Messages
462
I am trying to add start time in a access form when UpdateStart checked, it adds time in StartTime field, but only one problem I have user uncheck and checked back again StartTime also updated with the a new time.

Private Sub UpdateStart_AfterUpdate()
If Me.UpdateStart1 = -1 Then
Me.Name.Visible = True
Me.ValidationDate = Date

Me.StartTime = Now()

Else
Me.Name.Visible = False


End If
End Sub
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try amending this line of code

Code:
[COLOR=#333333]If Me.UpdateStart1 = -1 Then

to

Code:
If Me.UpdateStart1 = -1 and IsNull(Me.StartTime) then[/COLOR]
 
Upvote 0
I want when user clicked on UpdateStart1, then immediately Name visible, then only check the StartTime, if empty then fill in with the now (), time. If already a value in the box, then don't fill in the time.

Right now, when user click UpdateStart1, Name become available (That is what I want), but StartTime is populating with a current time instead of keeping the exiting time. Thanks.
 
Upvote 0

Forum statistics

Threads
1,223,676
Messages
6,173,754
Members
452,534
Latest member
autodiscreet

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