Timestamp assistance

Maverick_777

Board Regular
Joined
Sep 23, 2004
Messages
227
Guys,
I want to have a text box fill with a timestamp of data entry. The following did not work and I could use some advice...

=IIf([Estimated Hours]>0,"=now()","0")
=IIf([Estimated Hours]>0,'=now()',"0")
=IIf([Estimated Hours]>0,=now(),"0")

This is one text box checking to see if the text box "[Estimated Hours]" is greater than 0 and if so enter the current date and time. Now maybe =NOW() is not the best to use and I don't want the date stamp to change.

THoughts?
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Setting a control source to a formula does not save it to the table. You would want to have code in the form's BEFORE UPDATE event and you would use something like:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
   If Len(Me![Estimated Hours] & vbNullString) = 0 And Me![Estimated Hours] > 0 Then
      Me.YourDateTimeStampTextBoxNameHere = Now
   End If
End Sub

You would NOT put a 0 in a date field or else it will read as 12/30/1899
 
Upvote 0
THanks Bob. After trying again I was able to figure it out once I put the fields into the table.

Appreciate the help very much.
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,672
Members
452,937
Latest member
Bhg1984

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