Automating OnPrint Commands

T

TCF

Is there a way to call out all of the controls on a report in the OnPrint
function? I have a report where I want to add circles to several of the text
boxes on the screen. I hard coded all of them with the necessary info to get
the circle, but it seems like there should be an easier way to loop through
all of the controls and create the circles. Any help would be appreciated.

thanks
TCF
 
B

Brendan Reynolds

TCF said:
Is there a way to call out all of the controls on a report in the OnPrint
function? I have a report where I want to add circles to several of the
text
boxes on the screen. I hard coded all of them with the necessary info to
get
the circle, but it seems like there should be an easier way to loop
through
all of the controls and create the circles. Any help would be
appreciated.

thanks
TCF


Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

Dim ctl As Control

For Each ctl In Me.Section("Detail").Controls
If ctl.ControlType = acTextBox Then
'do whatever you need to do with the control here
Debug.Print ctl.Name
End If
Next ctl

End Sub
 

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