tabbing mulitline textbox and scrolling

ellandrd
ellandrd used Ask the Experts™
on
i have a form with a few problems i need to fix.  the first one is tabbing.  How can i tab in a multiline textbox?.  

when the users tabs, it jumps to next field.  It is possible to indent the text when hit tab?

the second problem is scrolling.  if i type some text into the mulitline textbox and try to scroll, it jumps to the next record.  i have scrollbars visible on the field and unless i click on the up and down arrow i cannot scroll the field.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Scrolling:

Set property ENTER KEY BEHAVIOUR to 'Next line in box" in the text box.
This ought to solve your TAB issue also.

Scott C.
Also, I believe your users will have to click on the box.
Each text box has 2 modes: OverStrike and Edit.  When in overstrike, the entire field is highlighted and if you hit a character key, the key value replaces the entire text.  In this mode, you will TAB to the next field.   If you hit the F2 key, it goes into the edit mode.  This allows you to move your cursor around to each character in the box.

Perhaps, if you want the TAB to 'stop' overstriking when you hit these multi-line text boxes, you could use the SENDKEYS "{F2}" COMMAND on the GOT FOCUS event to automatically kick into edit mode???

Of course, the user will have to hit <ENTER> (or F2 again) to get back to the overstrike mode.

Or simply train your users on how this works.

Scott C
Hello ellandrd,

Although you can enter a Tab in a textbox, it will not behave the way you expect. In fact, Access assumes the will never be a Tab character in textboxes and the resulting behavior is buggy. Try for yourself:

Private Sub Text0_KeyDown(KeyCode As Integer, Shift As Integer)
    Dim lngPos As Long
    If KeyCode = vbKeyTab Then
        lngPos = Text0.SelStart + 1
        Text0.SelText = vbTab
        Text0.SelStart = lngPos
        KeyCode = 0
    End If
End Sub

You will see that the Tab has been inserted when you try to move around with the mouse, but the display usually does not reflect it.

As for scrolling, it works fine if you drag the scroll bar. I believe you have a problem with the scroll button of your mouse rather than with the scroll bar. Up to Access 2003, the scroll button does not scroll inside controls, but scrolls among records. There is an event "On Mouse Wheel" which you can use to override that, but I wouldn't know how scroll a textbox.

You might find something at http://www.lebans.com but be prepared for some hard work.

Sorry, but I guess it's a "no go" for both of your questions!

(°v°)
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
Top Expert 2007

Commented:
See this (Free) Utility:

http://www.lebans.com/richtext.htm

mx

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial