RTF2 - control problem with printing

  • Thread starter MDziubek via AccessMonster.com
  • Start date
M

MDziubek via AccessMonster.com

Hi,

I use on my report's S. Lebans RTF2 Control, when I open report in
PrintPreview mode
I give all without errors. I have Access 2k3
But when I click Print I see message:

RTF2 this Property is read only

I search Internet and.. nothing.

Where is the bug?
I try to debug my code, but everythings is ok.
My all code on report:

Option Compare Database
Dim dane() As String
Dim P() As String
Dim rtfbase As String

Private Sub Report_Open(Cancel As Integer)
Dim rst As ADODB.Recordset
Dim sql As String
Dim zrodlo As String

Set rst = New ADODB.Recordset
sql = "select kolumny, rtf from cfg_wyd_P where klucz = 'nagmonit'"

zrodlo = "="
rst.Open sql, CurrentProject.Connection
rst.MoveFirst
dane = Split(rst!kolumny, ";")
If dane(0) <> "brak" Then
For k = 0 To UBound(dane)
zrodlo = zrodlo & "[" & dane(k) & "] & ""^"" & "
Next
Me.pola.ControlSource = left(zrodlo, Len(zrodlo) - 9)
Else
Me.pola.ControlSource = "=""brak"""
End If
rtfbase = rst!rtf
rst.Close
Set rst = Nothing

End Sub
Private Sub NaglówekGrupy0_Format(Cancel As Integer, FormatCount As Integer)

Dim war() As String
Dim rtf As String
Dim k As Integer
Dim Height As Integer
Dim ctr As Control
P = Split(Me.pola, "^")
rtf = rtfbase
If Me.pola <> "brak" Then
For k = 0 To UBound(dane)
rtf = Replace(rtf, "^^" & dane(k) & "^", P(k))
Next
End If
Me.rtf.Object.RTFtext = rtf

Height = Me.rtf.Object.RTFheight
Me.rtf.Height = Height
Me.Section(5).Height = Height + 595
For Each ctr In Me.Section(5).Controls
If ctr.ControlType = acLabel Then
ctr.Top = Height + 40
End If
Next

End Sub
 
M

MDziubek via AccessMonster.com

Stephen said:
Access does not allow you to write the properties of certain controls,
including all ActiveX controls in the Open event of the Report. It's not a
bug in my control.

You searched the Internet? Have you tried GoogleGRoups:

http://groups.google.ca/groups?hl=e...es&num=30&q=lebans+RTF2+read+only&safe=images

Thanks for your reply. I didn't try GoogleGroups, but I found that I can't
write the
properties on The Open Event so in my code on open I do nothing with RTF
Control, only in
NaglówekGrupy0_Format Event (this is: GroupHeader0_Format) I write propertis
here:

Me.rtf.Object.RTFtext = rtf
Height = Me.rtf.Object.RTFheight
Me.rtf.Height = Height
 

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