insert a circle to a number

Mario R. Perez

New member
Local time
Today, 17:18
Joined
May 14, 2020
Messages
20
Hello Group, A client is asking me if I can insert a Black circle where the line is very wide, (see pics), I tried downloading some fonts types , but I was not successful, some function that in event OnPrint makes the graphic.
thanks for advance
 

Attachments

  • f2 - Copy.png
    f2 - Copy.png
    7.4 KB · Views: 43
  • f2.png
    f2.png
    5.1 KB · Views: 41
Are you trying to put a circle on top of a barcode graphic or a barcode font?
 
You can use the Circle method of the report object. In the example below, I have a text box named Eggs with a numeric value. I want to draw a red circle around the value if it is less than 50.

Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    If Me.Eggs < 50 Then
        Me.DrawWidth = 30
        Me.Circle Step(Me.Eggs.Left + Me.Eggs.Width / 2, Me.Section(0).Height / 2), _
           Me.Section(0).Height / 2
    End If
End Sub
1737318876522.png
 
You can use the Circle method of the report object. In the example below, I have a text box named Eggs with a numeric value. I want to draw a red circle around the value if it is less than 50.

Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    If Me.Eggs < 50 Then
        Me.DrawWidth = 30
        Me.Circle Step(Me.Eggs.Left + Me.Eggs.Width / 2, Me.Section(0).Height / 2), _
           Me.Section(0).Height / 2
    End If
End Sub
View attachment 118101
That's what I need, what would I need to make the circle thicker?, Thanks a lot
 
circle the number #26, this can be 1 to 3 digits
Just making sure... The image you posted looked like it was a graphic, and the approach could be different for a graphic than a simple text. For instance, you may have to know the exact position of #26 if it's a graphic.
 
I love all the drawing capabilities that Access has for reports! and put together an extensive reference page here:

At the top, you can quick jump to general information, Methods, Properties, and a few Functions -- as well as pages with VBA Examples you can try yourself.

Here is my Help for Circle, which has notes so I can use it better myself and also includes a link to the Microsoft help for Circle.

Duane @DHookom has some great examples too.

To draw a circle on top, as a minimum, you'll need a center coordinate and a radius. You can use the boundaries of your image control to figure those out ... but how to tell if the image is too wide? and what would be the position? Do you have a way to logically determine that?

Before the circle is drawn, you can set (for the Report object) DrawWidth, ForeColor (which I forgot to mention here! since you can optionally set Color to override that), DrawStyle, FillStyle (0 for Transparent), etc

Note that the Circle method can be used to draw circles with different (or no) fill color and outline, as well as arcs that are filled or not, and ellipses
 
Last edited:
ps, @Mario R. Perez , in case you don't know how many digits there will be ... perhaps you want to use Line instead of Circle? And possibly draw more than one line? Right boundary and Top? possibly also Bottom line? but you don't want lines to cover your data!

However, it looks like there is enough space to make a Circle/ellipse enclose more space to the left
 
ps, @Mario R. Perez , in case you don't know how many digits there will be ... perhaps you want to use Line instead of Circle? And possibly draw more than one line? Right boundary and Top? possibly also Bottom line? but you don't want lines to cover your data!

However, it looks like there is enough space to make a Circle/ellipse enclose more space to the left
Thank you very much, Very useful information and examples, Mario
 

Users who are viewing this thread

Back
Top Bottom