Help with code

S

SF

Hi,

I am in the process of converting Leban RTF2 to Access 2007 RTF. The process
is that I am trying to copy the content from RTF2 and paste to other control
(of the same filed). In this process, the are some part of text that need
formating, what I try to do is to put this code in a button hope to do the
trick (but It will not). What I want to do is check to see previous control
whether on text42 or text 44, then block some part of text, change Font and
It size

Dim ctl As Control

Debug.Print Screen.PreviousControl.Name

If Screen.PreviousControl.Name = Me.Text42 Then
With Me.Text42
If .SelLength > 0 Then
.FontName = "Calibri"
.FontSize = 12
End If
End With
ElseIf Screen.PreviousControl.Name = Me.Text44 Then
With Me.Text44
If .SelLength > 0 Then
.FontName = "Calibri"
.FontSize = 12
End If
End With
End If

SF
 

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