S
Snokke
Hi
Can anyone show me how to populate a textbox in my details section of
my report?
I'm creating a recordset in VBA.
While I'm looping trough this recordset I'd like to populate a textbox
everytime the loop makes a loop.
(I'm doing alot of control in the loop, thats way I'm using VBA.)
That is, I'd like to have this result in the report:
[example]
Text: FindingA
Text: FindingB
Text: FindingD
Text: FindingE
Text: FindingF
Text: FindingJ
[/example]
And where, in what event, do I place the code in the report?
If I have this loop:
I have tried (in the Report_Open event):
All this have given me is:
Run-time error '2448':
You can't assign a value to this object.
I'm stuck and hope for some help
Regards
Andreas
Can anyone show me how to populate a textbox in my details section of
my report?
I'm creating a recordset in VBA.
While I'm looping trough this recordset I'd like to populate a textbox
everytime the loop makes a loop.
(I'm doing alot of control in the loop, thats way I'm using VBA.)
That is, I'd like to have this result in the report:
[example]
Text: FindingA
Text: FindingB
Text: FindingD
Text: FindingE
Text: FindingF
Text: FindingJ
[/example]
And where, in what event, do I place the code in the report?
If I have this loop:
Code:
If Not rst.BOF And Not rst.EOF Then
Do Until rst.EOF
'What code should I place here to populate a textebox
namned "txtFirst"
'in the report namned "rptFirst" with a db filed named
"Firstname" (rst.Fields("Firstname"))
rst.MoveNext
Loop
End If
I have tried (in the Report_Open event):
Code:
Me.txtFirst.Value = rst.Fields("Firstname")
Code:
Me.Controls("txtFirst").Value = rst.Fields("Firstname")
Code:
[Reports]![rptFirst]![txtFirst].Value = rst.Fields("Firstname")
All this have given me is:
Run-time error '2448':
You can't assign a value to this object.
I'm stuck and hope for some help
Regards
Andreas