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
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