setting a label on a reoport from VBA

  • Thread starter Thread starter Ian
  • Start date Start date
I

Ian

How do I vrite VBA code to set a textbox or label on a
report in the OnPrint event?

I had made a textbox by using the CreateReportControl -
but then I wanted to make a circle by using the
method "circle" which only works at the time of
OnPrint...so no my textbox doesnt work.

So how do I make a textbox or label in the OnPrint event?

Ian
 
Well, that could probably do it, but I like the
more "clean" solution where I build the whole report from
scratch - because I would have a varying number of
textboxes.

I started out doing it in "design view" by using
CreateReportControl - but to draw a circle, I had to
switch to the "onPrint" approach.... but now I have the
textbox issue.

So if I could draw a circle in design view I could just
revert to my original approach - and that would solve my
textbox problem..

Any ideas?

Ian
 
Have you considered using Me.Print rather than creating a control. The
following code will print on your report and then circle it with a red
circle. No controls involved....
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim lngX As Long
Dim lngRadius As Long
Me.CurrentX = 1000
Me.CurrentY = 1000
Me.FontSize = 24
Me.Print "Circle Me"
lngRadius = (Me.CurrentX - 1000) / 2
lngX = 1000 + lngRadius
Me.Circle (lngX, 1000 + 100), lngRadius + 20, vbRed
End Sub
 
Thanks - that solves the issue of putting text on a report
at time of printing!

It would however still be better to make the report in
design mode - because then I could manualy edit the
generated report....if I needed to make some last-minute-
changes without having to reprogram.

So then I'm back to: How do I make a circle on a report in
design mode?

Ian
 
Ok - but that requires a picture of a circle - and it cant
be scaled from within VBA...

Is there really no other way of making a circle in a
report design view? (I'll post again to see if there are
any other inputs... Thanks so far.)

Ian
 
Back
Top