Memo Pop-Up

  • Thread starter Thread starter kirstie adam
  • Start date Start date
K

kirstie adam

I have a form which is a simple pop-up with 2 fields on it, 1st field is the
prmary key to link to another form, and the 2nd field is just a really big
memo box which is used for the user to makes comments and to/do actions on
that case. The only other thing is an exit form button.
My problem is when the user opens the form, all the text they have already
written is highlighted. One-click and they wipe it away by mistake.
I want that when they open this form, the cursor is blinking away at the end
of the already written text. Am sure it can be done, just need someone to
tell me how!!!

Any suggestions much appreciated (especially ones that work!)

Kirstie
 
* kirstie adam said:
I have a form which is a simple pop-up with 2 fields on it, 1st field is the
prmary key to link to another form, and the 2nd field is just a really big
memo box which is used for the user to makes comments and to/do actions on
that case. The only other thing is an exit form button.
My problem is when the user opens the form, all the text they have already
written is highlighted. One-click and they wipe it away by mistake.
I want that when they open this form, the cursor is blinking away at the end
of the already written text. Am sure it can be done, just need someone to
tell me how!!!

Any suggestions much appreciated (especially ones that work!)

Kirstie
Kirstie,

Try this:

Private Sub Form_Current()
With Me.tbxMemo
.SetFocus
.SelStart = Len(.Value)
End With
End Sub

HTH
Bob L.
 
excellent, worked perfectly thanks

Bob L. said:
Kirstie,

Try this:

Private Sub Form_Current()
With Me.tbxMemo
.SetFocus
.SelStart = Len(.Value)
End With
End Sub

HTH
Bob L.
 
Tank,

Genius!
worked better than the SelLengh solution Bob (sorry Bob!) gave me as it
means i can see all the text when the forms open rather than having to
scroll back up, which is good when i just want to read what's there and not
necessarily edit the text.

Thanks to both of you for your help.

Kirstie
 
Don't know how "really big" this memo field usually is, Kirstie, memo fields
can be 65k, but if it passes 32,767 characters the SelStart will throw an
overflow error. That's because SelStart's arguement is an Integer. To work
around this I use the following:

If Not IsNull(MemoBox) Then
If Len(MemoBox) < 32767 Then
MemoBox.SelStart = Len(MemoBox) + 1
Else
SendKeys "^{END}"
End If
End If

I don't really like using SENDKEYS, which is why I only invoke it if the memo
field is too big to use SelStart, but sometimes you have to.
 
Should have explained, the

SendKeys "^{END}"

is the same as keying <Control> + <End>.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top