R
rocco
hello,
from some other post I have read that textbox value can be changed throught
the format event of a report section.
If this is true, why this code wont work?
<code>
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Application.Echo False
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
Dim ctl As Control
rst.Open "tblabs", CurrentProject.Connection, adOpenStatic, adLockReadOnly
Dim i As Integer
With rst
.Filter = "strpazid='" & Forms("totali").codfisc & "'"
For Each ctl In Reports("reportabs2").Controls
If ctl.Name Like "q*" Then
Select Case .Fields(ctl.Name)
Case Is = 1
ctl.Value = "SI"
Case Is = 0
ctl.Value = "NO"
Case Is = 9
ctl.Value = "N/A"
End Select
End If
Next ctl
End With
</code>
It stops on whene trying to write value for the first ctl saying "You cannot
assign value to this object".
thanks
Rocco
from some other post I have read that textbox value can be changed throught
the format event of a report section.
If this is true, why this code wont work?
<code>
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Application.Echo False
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
Dim ctl As Control
rst.Open "tblabs", CurrentProject.Connection, adOpenStatic, adLockReadOnly
Dim i As Integer
With rst
.Filter = "strpazid='" & Forms("totali").codfisc & "'"
For Each ctl In Reports("reportabs2").Controls
If ctl.Name Like "q*" Then
Select Case .Fields(ctl.Name)
Case Is = 1
ctl.Value = "SI"
Case Is = 0
ctl.Value = "NO"
Case Is = 9
ctl.Value = "N/A"
End Select
End If
Next ctl
End With
</code>
It stops on whene trying to write value for the first ctl saying "You cannot
assign value to this object".
thanks
Rocco