Format text box as Bulleted List as default

S

Steve P

In AC2007 I would like to have a text box (rich text format)
on my form automatically format the text that a user enters as a
bulleted list when they begin typing. Currently the user needs to
click the "Start a bulleted list" button on the ribbon before they
begin typing.
 
D

Dirk Goldgar

Steve P said:
In AC2007 I would like to have a text box (rich text format)
on my form automatically format the text that a user enters as a
bulleted list when they begin typing. Currently the user needs to
click the "Start a bulleted list" button on the ribbon before they
begin typing.


I haven't tried this out to see how it would work in practice, but you could
try something like this in the control's GotFocus event:

'------ start of (untried) code ------
Private Sub txtMyRichText_GotFocus

With Me.txtMyRichText
If Len(.Value & vbNullString) = 0 Then
.Value = "<ul><li></li></ul>"
End If
End With

End Sub
'------ end of (untried) code ------
 
S

Steve P

Dirk Goldgar said:
I haven't tried this out to see how it would work in practice, but you could
try something like this in the control's GotFocus event:

'------ start of (untried) code ------
Private Sub txtMyRichText_GotFocus

With Me.txtMyRichText
If Len(.Value & vbNullString) = 0 Then
.Value = "<ul><li></li></ul>"
End If
End With

End Sub
'------ end of (untried) code ------

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)


That works.

Thank You!
 

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