A family of Microsoft relational database management systems designed for ease of use.
Hi. You could try the following:
Me.MedicalNotes.SetFocus
Me.MedicalNotes.SelStart = Len(Me.MedicalNotes)+1
Hope that helps...
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi, I have a Long Text field and a button with vba code that enters a new timestamp on a new line in the long text field. I used this code
Me.MedicalNotes = Me.MedicalNotes & vbCrlF & Now()
I would like the cursor to position itself after the Now() so the user can add a note after the time without having to manually move the mouse behind the timestamp. It should be simple but I can't seem to do it lol.
I'd really appreciate any help! :-)
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Hi. You could try the following:
Me.MedicalNotes.SetFocus
Me.MedicalNotes.SelStart = Len(Me.MedicalNotes)+1
Hope that helps...
Thanks! That worked.
Hi,
You're welcome. Good luck with your project.
Thanks for your reply.
I would prefer to have it the way you described. however I would need to be able to click on a button and have a time stamped on to a new record in the notes notes subform and move the cursor behind the timestamp. I'm not sure exactly how that would work.
The db I'm making for a small EMS/Medical/Police dispatch office so when they receive a call they'd just need to click on a button (for example, "ON SCENE") and have the timestamp and on-scene entry placed into a new notes field without the user having to manually type it.
Would you by any chance know how I could do that?
Thanks,
Thomas
Thanks! That worked.
You would be better served if you created a separate table for notes so that each note is its own record with the following fields:
This has many benefits, particularly being able to search for specific notes by date, author, etc.. Insertions are as simple as adding a new record. More importantly, previous notes can be protected from unauthorized or inadvertent changes by other authors.
There are a number of drawbacks to trying to keep notes all in one field. One is that you can either run out of space in a Text field with a max of 255 characters, or your record can become excessively large and difficult to read/search using a memo field. The size of the note field can cause sluggish response times for record views and searches. As in your case, it may be necessary to perform some programming to handle desired insertion points and other data management. Lastly, each time anyone edits the field, previous notes are in jeopardy of being inadvertently altered or destroyed. In short, it's not a good idea or practice to use a single field for notes as you are attempting to do.