By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,471 Members | 2,264 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,471 IT Pros & Developers. It's quick & easy.

date stamp a memo/text box automtatically

P: 4
I want to automatically date stamp a memo/text box when i click a combo box. i know how to start the code bulider in the event properties of the combo box and get it to select the memo/text box i.e combo123.SetFocus and combo123.Value = today () but what i would like it to do is to go to the end of whatever text is already in the memo/text box, select a new line, date stamp it and select another line ready to add more notes
Sep 15 '07 #1
Share this Question
Share on Google+
6 Replies


puppydogbuddy
Expert 100+
P: 1,923
I want to automatically date stamp a memo/text box when i click a combo box. i know how to start the code bulider in the event properties of the combo box and get it to select the memo/text box i.e combo123.SetFocus and combo123.Value = today () but what i would like it to do is to go to the end of whatever text is already in the memo/text box, select a new line, date stamp it and select another line ready to add more notes
If your memo field is called Memofield then this code in the On Enter event of your textbox should do what you want. Obviously change the name below to the actual name of your field...

Private Sub MemoField_Enter()
Me.MemoField = Me.MemoField & " " & Now()
End Sub
Sep 16 '07 #2

puppydogbuddy
Expert 100+
P: 1,923
If you want to update the memobox every time you make a selection from a combo box, use the following code:

Private Sub YourCombo_AfterUpdate()
Me.MemoField = Me.MemoField & " " & Now()
End Sub
Sep 16 '07 #3

P: 4
If you want to update the memobox every time you make a selection from a combo box, use the following code:

Private Sub YourCombo_AfterUpdate()
Me.MemoField = Me.MemoField & " " & Now()
End Sub

Thanks... just one more thing. The command above leaves the text in the cell highlighted. How do i get it to send the cursor to the end of the text then carriage return to start a new line?
Sep 17 '07 #4

puppydogbuddy
Expert 100+
P: 1,923
Thanks... just one more thing. The command above leaves the text in the cell highlighted. How do i get it to send the cursor to the end of the text then carriage return to start a new line?
Try this:

Private Sub YourCombo_AfterUpdate()
Me.MemoField = Me.MemoField & " " & Now() & vbCr & vbLf
End Sub
Sep 17 '07 #5

P: 4
Try this:

Private Sub YourCombo_AfterUpdate()
Me.MemoField = Me.MemoField & " " & Now() & vbCr & vbLf
End Sub

thanks again one last thing how do i get the cursor to flash at the end of the text ready to type rather than select and highlight the whole of the text box.
Sep 18 '07 #6

puppydogbuddy
Expert 100+
P: 1,923
thanks again one last thing how do i get the cursor to flash at the end of the text ready to type rather than select and highlight the whole of the text box.

Try this:

Private Sub YourCombo_AfterUpdate()
Me.MemoField = Me.MemoField & " " & Now() & vbCr & vbLf
Me!MemoField.SelStart = Me!MemoField.SelLength
End Sub
Sep 18 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.