tabs in memo field

D

David Davis

Is it possible to have the "tab" character in a memo field. It is alot
easier to align columns in a memo field if you can tab to the correct
position.
 
A

Allen Browne

Access 2007 supports rich text in memo fields, so you can use tab characters
in the newest version.

In older versions, you cannot embed a tab character in the text. The nearest
you can do is to trap the character in the KeyDown event of the text box,
and substitute 4(?) spaces in the Text.

Use SelStart and SelLen to get back to the right place. Unfortunately, this
doesn't work with more than 32k characters in the field.
 
D

David Davis

I'm using Access 2007. How do you enable the "Tab" key in the memo field. I
don't see an option for it. When I press the tab key, the cursor moves to
the next field instead of moving within the memo field
--
Thanks

David Davis


Allen Browne said:
Access 2007 supports rich text in memo fields, so you can use tab characters
in the newest version.

In older versions, you cannot embed a tab character in the text. The nearest
you can do is to trap the character in the KeyDown event of the text box,
and substitute 4(?) spaces in the Text.

Use SelStart and SelLen to get back to the right place. Unfortunately, this
doesn't work with more than 32k characters in the field.
 
J

Joel Padmore

Trap the keycode for the Tab key in the KeyPress event of the textbox.
Concatenate the number of spaces for the tab

.. Here is some code. My code uses 4 spaces for the tab

If KeyAscii = 9 Then
Me.YourControlName = Me.YourControlName & " "
End If
 

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

Top