Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

How get to the beginning of a text field via code

I am using the following code to add a comment to a text field.  But I want the now comment to be at the beginning of the field.  Is there a way to force a [Home] key so the new comment is at the beginning?

Me.txtComments = Me.txtComments & vbCrLf & Me.txtNewComment & vbCrLf & DLookup("[CurrentUser]", "LOCALtblCurrentUser") & " " & Now() & vbCrLf
ASKER CERTIFIED SOLUTION
Avatar of Jeff Darling
Jeff Darling
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Generally, I think it is bad practice to add new comments to a comment field.

I prefer to have a separate table for the comments, so that each comment is a single record, which can be displayed in a continuous subform.  With this technique, you have the added option of being able to prevent the users from changing previous comments, to preserve a comment history.
Avatar of SteveL13

ASKER

Jeff.  Thanks.  That did it.

Dale, I agree and normally do it that way.  But in this case the "simple" method will be just fine.