VB6 code converted to VBA / Access2003

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • 2D Rick

    #1

    VB6 code converted to VBA / Access2003

    With the help from members in the VB forum I've pieced together code
    that works in VB6 to create radial text similar to "text on a path"
    seen in graphics programs.(on a circle only)
    I use an Access2003 app to gather the data via a barcode reader which
    is then concatenated for the radial text.
    Is there any possibility that this code can be converted to run in
    Access2003?


    Option Explicit
    Dim dblSpacing As Double
    Dim dblRadius As Single
    Dim s1 As String
    Dim sMarginX As Single
    Dim sMarginY As Single

    Private Const LF_FACESIZE = 32
    Private Type LOGFONT
    lfHeight As Long
    lfWidth As Long
    lfEscapement As Long
    lfOrientation As Long
    lfWeight As Long
    lfItalic As Byte
    lfUnderline As Byte
    lfStrikeOut As Byte
    lfCharSet As Byte
    lfOutPrecision As Byte
    lfClipPrecision As Byte
    lfQuality As Byte
    lfPitchAndFamil y As Byte
    lfFaceName As String * LF_FACESIZE
    End Type
    Private Declare Function CreateFontIndir ect Lib "gdi32" _
    Alias "CreateFontIndi rectA" (lpLogFont As LOGFONT) As Long
    Private Declare Function SelectObject Lib "gdi32" _
    (ByVal hdc As Long, ByVal hObject As Long) As Long
    Private Declare Function DeleteObject Lib "gdi32" _
    (ByVal hObject As Long) As Long
    Private Declare Function TextOut Lib "gdi32" Alias _
    "TextOutA" (ByVal hdc As Long, ByVal X As Long, ByVal _
    Y As Long, ByVal lpString As String, ByVal nCount _
    As Long) As Long
    Private Declare Function SetBkMode Lib "gdi32" _
    (ByVal hdc As Long, ByVal nBkMode As Long) As Long
    Private Declare Function GetTextMetrics Lib "gdi32" _
    Alias "GetTextMetrics A" (ByVal hdc As Long, _
    lpMetrics As TEXTMETRIC) As Long
    Private Type TEXTMETRIC
    tmHeight As Long
    tmAscent As Long
    tmDescent As Long
    tmInternalLeadi ng As Long
    tmExternalLeadi ng As Long
    tmAveCharWidth As Long
    tmMaxCharWidth As Long
    tmWeight As Long
    tmOverhang As Long
    tmDigitizedAspe ctX As Long
    tmDigitizedAspe ctY As Long
    tmFirstChar As Byte
    tmLastChar As Byte
    tmDefaultChar As Byte
    tmBreakChar As Byte
    tmItalic As Byte
    tmUnderlined As Byte
    tmStruckOut As Byte
    tmPitchAndFamil y As Byte
    tmCharSet As Byte
    End Type
    Private Const TRANSPARENT = 1
    Private Const OPAQUE = 2
    Private Const RadToTenthDegre e As Single = 572.957795
    Private Const pi = 3.14159
    Private myhDC As Long
    Private new_font As Long, old_font As Long


    Private Sub RotateFont(outD evice As Object, angle As Single)
    Dim myAngle As Long
    myhDC = outDevice.hdc
    myAngle = angle * RadToTenthDegre e ' convert from radians
    Dim log_font As LOGFONT
    With log_font
    .lfEscapement = myAngle
    .lfOrientation = myAngle
    .lfHeight = outDevice.Scale Y(outDevice.Fon t.Size * 20, vbTwips,
    vbPixels)
    .lfFaceName = outDevice.Font. Name & vbNullChar
    If outDevice.Font. Bold = True Then
    .lfWeight = 700
    Else
    .lfWeight = 400
    End If
    .lfItalic = outDevice.Font. Italic
    .lfUnderline = outDevice.Font. Underline
    End With
    new_font = CreateFontIndir ect(log_font)
    old_font = SelectObject(my hDC, new_font)
    End Sub


    Private Sub CircleText(obj As Object, x1 As Single, _
    y1 As Single, r1 As Single, s1 As String)
    ' add code later to check for valid object type
    Dim angle As Single, p As Long, n As Long
    Dim xp As Single, yp As Single, position As Single
    Dim myhDC As Long, ret As Long
    Dim NewFontMetrics As TEXTMETRIC

    obj.ScaleMode = vbInches
    p = Len(s1)
    angle = (dblSpacing * pi) / p
    position = pi * (txtRotate_Hidd en / 12) + 3
    myhDC = obj.hdc
    For n = 0 To p - 1
    xp = x1 - (r1 * Sin(position))
    yp = y1 - (r1 * Cos(position))
    xp = obj.ScaleX(xp, vbInches, vbPixels)
    yp = obj.ScaleY(yp, vbInches, vbPixels)
    RotateFont obj, position
    GetTextMetrics myhDC, NewFontMetrics ' << NOT obj.hdc

    ' Adjust for variances in font cell height between individual
    ' characters by lining up the baselines
    xp = xp - NewFontMetrics. tmAscent * Sin(position)
    yp = yp - NewFontMetrics. tmAscent * Cos(position)


    ret = TextOut(myhDC, xp, yp, Mid$(s1, n + 1, 1), 1)
    ' change the font back and get rid of the new font
    SelectObject myhDC, old_font
    DeleteObject new_font
    position = position - angle
    Next n
    End Sub

    Private Sub cmdPrint_Click( )
    Printer.Font.Na me = "Courier New"
    Printer.Font.Si ze = txt_Font_Size

    Select Case Val(txt_Radius_ Hidden)
    Case 1 To 49
    sMarginX = 2
    sMarginY = 2
    Case 50 To 59
    sMarginX = 2.5
    sMarginY = 2.5
    Case 60 To 75
    sMarginX = 3
    sMarginY = 3
    Case 76 To 100
    sMarginX = 4
    sMarginY = 4
    End Select

    ' s1 = "3072670-901 LN05P123 SN050136012345 M555 "
    dblSpacing = Len(s1) * (txt_Radial_Spa cing / 1000) + 0.02
    Printer.Line (0, 0)-(0, 0), RGB(255, 255, 255), BF
    CircleText Printer, sMarginX, sMarginY, txt_Radius_Hidd en / 32, s1
    ' CircleText Printer, 2, 2, txt_Radius_Hidd en / 32, s1

    Printer.EndDoc
    Call Print_to_Screen

    End Sub

    Public Sub Print_to_Screen ()

    Me.Cls
    Me.Print
    Me.Font.Name = "Courier New"
    Me.Font.Size = txt_Font_Size
    Me.FontBold = True
    ' s1 = "3072670-901 LN05P123 SN050136012345 M555 "
    dblSpacing = Len(s1) * (txt_Radial_Spa cing / 1000) + 0.02
    CircleText Me, 4, 4, txt_Radius_Hidd en / 32, s1
    DrawWidth = 5
    Me.Line (1, 1.5)-(8, 1.5)
    Me.Line (1, 1.5)-(1, 8)
    End Sub

    Private Sub Form_Activate()
    Call Print_to_Screen
    End Sub

    Private Sub Form_Load()
    txt_Radius_Hidd en = 32
    txt_Radial_Spac ing = 30
    txt_Font_Size = 10
    txt_Radius_Visi ble = txt_Radius_Hidd en / 32
    sMarginX = 1
    sMarginY = 1

    Call Get_Data
    End Sub

    Private Sub spin_Radial_Spa cing_Change()
    txt_Radial_Spac ing = spin_Radial_Spa cing.Value
    Call Print_to_Screen
    End Sub

    Private Sub spin_Radius_Cha nge()
    txt_Radius_Hidd en = spin_Radius.Val ue
    txt_Radius_Visi ble = Format((txt_Rad ius_Hidden / 32), "0.0000")
    Call Print_to_Screen
    End Sub

    Private Sub spin_Font_Size_ Change()
    Call Print_to_Screen
    End Sub

    Public Function Get_Data()
    Dim ExtDB As Database
    Dim ExtTable As Recordset
    Dim varRecords As Variant
    Dim intRcount As Integer
    Dim intMdayLength As String

    Set ExtDB =
    DBEngine.Worksp aces(0).OpenDat abase("S:\TRANS FER\!pics\!Stam ping
    Program Cell15\!Stampin g
    Program\Part_Ma rking_Input_2-18-03_102_bldg_200 3.mdb") ' external DB
    Set ExtTable = ExtDB.OpenRecor dset("tbl_Label _Data") ' external
    table

    If ExtTable.Record Count <= 0 Then
    MsgBox "There is no current data to use"
    End
    End If

    intRcount = ExtTable.Record Count
    ExtTable.MoveFi rst
    varRecords = ExtTable.GetRow s(intRcount)

    If IsNull(varRecor ds(5, 0)) Then
    intMdayLength = ""
    Else
    intMdayLength = "M" & varRecords(5, 0)
    End If

    s1 = UCase(varRecord s(1, 0)) & " " & UCase(varRecord s(2, 0)) & " "
    & UCase(varRecord s(3, 0)) & " " & intMdayLength

    ExtTable.Close
    ExtDB.Close

    End Function

    Private Sub spin_Rotate_Cha nge()

    txtRotate_Hidde n = spin_Rotate.Val ue
    txtRotate_Visib le = txtRotate_Hidde n * 15 & " deg."
    Call Print_to_Screen

    End Sub

  • Tom van Stiphout

    #2
    Re: VB6 code converted to VBA / Access2003

    On 31 Oct 2005 07:57:08 -0800, "2D Rick" <rbrowniii@comp userve.com>
    wrote:

    What happens when you try?

    Without studying all your code, it seems to be using a lot of Windows
    API functions that would work the same from VB6 as from Acces2003, so
    chances are most of it will work just fine.

    -Tom.

    [color=blue]
    >With the help from members in the VB forum I've pieced together code
    >that works in VB6 to create radial text similar to "text on a path"
    >seen in graphics programs.(on a circle only)
    >I use an Access2003 app to gather the data via a barcode reader which
    >is then concatenated for the radial text.
    >Is there any possibility that this code can be converted to run in
    >Access2003?
    >[/color]
    <clip>

    Comment

    • Stephen Lebans

      #3
      Re: VB6 code converted to VBA / Access2003

      In taking a quick glance at the code I would say you have two issues.

      1) Access does not expose a handle to a window or control's Device
      Context(hDC).

      2) The Access Form object does not expose any drawing methods.

      If want to get the code up and running quickly then use the vbPictureBox
      class on my site. It exposes a hDC and supports several drawing methods.

      --

      HTH
      Stephen Lebans

      Access Code, Tips and Tricks
      Please respond only to the newsgroups so everyone can benefit.



      "2D Rick" <rbrowniii@comp userve.com> wrote in message
      news:1130774228 .221650.24110@g 47g2000cwa.goog legroups.com...[color=blue]
      > With the help from members in the VB forum I've pieced together code
      > that works in VB6 to create radial text similar to "text on a path"
      > seen in graphics programs.(on a circle only)
      > I use an Access2003 app to gather the data via a barcode reader which
      > is then concatenated for the radial text.
      > Is there any possibility that this code can be converted to run in
      > Access2003?
      >
      >
      > Option Explicit
      > Dim dblSpacing As Double
      > Dim dblRadius As Single
      > Dim s1 As String
      > Dim sMarginX As Single
      > Dim sMarginY As Single
      >
      > Private Const LF_FACESIZE = 32
      > Private Type LOGFONT
      > lfHeight As Long
      > lfWidth As Long
      > lfEscapement As Long
      > lfOrientation As Long
      > lfWeight As Long
      > lfItalic As Byte
      > lfUnderline As Byte
      > lfStrikeOut As Byte
      > lfCharSet As Byte
      > lfOutPrecision As Byte
      > lfClipPrecision As Byte
      > lfQuality As Byte
      > lfPitchAndFamil y As Byte
      > lfFaceName As String * LF_FACESIZE
      > End Type
      > Private Declare Function CreateFontIndir ect Lib "gdi32" _
      > Alias "CreateFontIndi rectA" (lpLogFont As LOGFONT) As Long
      > Private Declare Function SelectObject Lib "gdi32" _
      > (ByVal hdc As Long, ByVal hObject As Long) As Long
      > Private Declare Function DeleteObject Lib "gdi32" _
      > (ByVal hObject As Long) As Long
      > Private Declare Function TextOut Lib "gdi32" Alias _
      > "TextOutA" (ByVal hdc As Long, ByVal X As Long, ByVal _
      > Y As Long, ByVal lpString As String, ByVal nCount _
      > As Long) As Long
      > Private Declare Function SetBkMode Lib "gdi32" _
      > (ByVal hdc As Long, ByVal nBkMode As Long) As Long
      > Private Declare Function GetTextMetrics Lib "gdi32" _
      > Alias "GetTextMetrics A" (ByVal hdc As Long, _
      > lpMetrics As TEXTMETRIC) As Long
      > Private Type TEXTMETRIC
      > tmHeight As Long
      > tmAscent As Long
      > tmDescent As Long
      > tmInternalLeadi ng As Long
      > tmExternalLeadi ng As Long
      > tmAveCharWidth As Long
      > tmMaxCharWidth As Long
      > tmWeight As Long
      > tmOverhang As Long
      > tmDigitizedAspe ctX As Long
      > tmDigitizedAspe ctY As Long
      > tmFirstChar As Byte
      > tmLastChar As Byte
      > tmDefaultChar As Byte
      > tmBreakChar As Byte
      > tmItalic As Byte
      > tmUnderlined As Byte
      > tmStruckOut As Byte
      > tmPitchAndFamil y As Byte
      > tmCharSet As Byte
      > End Type
      > Private Const TRANSPARENT = 1
      > Private Const OPAQUE = 2
      > Private Const RadToTenthDegre e As Single = 572.957795
      > Private Const pi = 3.14159
      > Private myhDC As Long
      > Private new_font As Long, old_font As Long
      >
      >
      > Private Sub RotateFont(outD evice As Object, angle As Single)
      > Dim myAngle As Long
      > myhDC = outDevice.hdc
      > myAngle = angle * RadToTenthDegre e ' convert from radians
      > Dim log_font As LOGFONT
      > With log_font
      > .lfEscapement = myAngle
      > .lfOrientation = myAngle
      > .lfHeight = outDevice.Scale Y(outDevice.Fon t.Size * 20, vbTwips,
      > vbPixels)
      > .lfFaceName = outDevice.Font. Name & vbNullChar
      > If outDevice.Font. Bold = True Then
      > .lfWeight = 700
      > Else
      > .lfWeight = 400
      > End If
      > .lfItalic = outDevice.Font. Italic
      > .lfUnderline = outDevice.Font. Underline
      > End With
      > new_font = CreateFontIndir ect(log_font)
      > old_font = SelectObject(my hDC, new_font)
      > End Sub
      >
      >
      > Private Sub CircleText(obj As Object, x1 As Single, _
      > y1 As Single, r1 As Single, s1 As String)
      > ' add code later to check for valid object type
      > Dim angle As Single, p As Long, n As Long
      > Dim xp As Single, yp As Single, position As Single
      > Dim myhDC As Long, ret As Long
      > Dim NewFontMetrics As TEXTMETRIC
      >
      > obj.ScaleMode = vbInches
      > p = Len(s1)
      > angle = (dblSpacing * pi) / p
      > position = pi * (txtRotate_Hidd en / 12) + 3
      > myhDC = obj.hdc
      > For n = 0 To p - 1
      > xp = x1 - (r1 * Sin(position))
      > yp = y1 - (r1 * Cos(position))
      > xp = obj.ScaleX(xp, vbInches, vbPixels)
      > yp = obj.ScaleY(yp, vbInches, vbPixels)
      > RotateFont obj, position
      > GetTextMetrics myhDC, NewFontMetrics ' << NOT obj.hdc
      >
      > ' Adjust for variances in font cell height between individual
      > ' characters by lining up the baselines
      > xp = xp - NewFontMetrics. tmAscent * Sin(position)
      > yp = yp - NewFontMetrics. tmAscent * Cos(position)
      >
      >
      > ret = TextOut(myhDC, xp, yp, Mid$(s1, n + 1, 1), 1)
      > ' change the font back and get rid of the new font
      > SelectObject myhDC, old_font
      > DeleteObject new_font
      > position = position - angle
      > Next n
      > End Sub
      >
      > Private Sub cmdPrint_Click( )
      > Printer.Font.Na me = "Courier New"
      > Printer.Font.Si ze = txt_Font_Size
      >
      > Select Case Val(txt_Radius_ Hidden)
      > Case 1 To 49
      > sMarginX = 2
      > sMarginY = 2
      > Case 50 To 59
      > sMarginX = 2.5
      > sMarginY = 2.5
      > Case 60 To 75
      > sMarginX = 3
      > sMarginY = 3
      > Case 76 To 100
      > sMarginX = 4
      > sMarginY = 4
      > End Select
      >
      > ' s1 = "3072670-901 LN05P123 SN050136012345 M555 "
      > dblSpacing = Len(s1) * (txt_Radial_Spa cing / 1000) + 0.02
      > Printer.Line (0, 0)-(0, 0), RGB(255, 255, 255), BF
      > CircleText Printer, sMarginX, sMarginY, txt_Radius_Hidd en / 32, s1
      > ' CircleText Printer, 2, 2, txt_Radius_Hidd en / 32, s1
      >
      > Printer.EndDoc
      > Call Print_to_Screen
      >
      > End Sub
      >
      > Public Sub Print_to_Screen ()
      >
      > Me.Cls
      > Me.Print
      > Me.Font.Name = "Courier New"
      > Me.Font.Size = txt_Font_Size
      > Me.FontBold = True
      > ' s1 = "3072670-901 LN05P123 SN050136012345 M555 "
      > dblSpacing = Len(s1) * (txt_Radial_Spa cing / 1000) + 0.02
      > CircleText Me, 4, 4, txt_Radius_Hidd en / 32, s1
      > DrawWidth = 5
      > Me.Line (1, 1.5)-(8, 1.5)
      > Me.Line (1, 1.5)-(1, 8)
      > End Sub
      >
      > Private Sub Form_Activate()
      > Call Print_to_Screen
      > End Sub
      >
      > Private Sub Form_Load()
      > txt_Radius_Hidd en = 32
      > txt_Radial_Spac ing = 30
      > txt_Font_Size = 10
      > txt_Radius_Visi ble = txt_Radius_Hidd en / 32
      > sMarginX = 1
      > sMarginY = 1
      >
      > Call Get_Data
      > End Sub
      >
      > Private Sub spin_Radial_Spa cing_Change()
      > txt_Radial_Spac ing = spin_Radial_Spa cing.Value
      > Call Print_to_Screen
      > End Sub
      >
      > Private Sub spin_Radius_Cha nge()
      > txt_Radius_Hidd en = spin_Radius.Val ue
      > txt_Radius_Visi ble = Format((txt_Rad ius_Hidden / 32), "0.0000")
      > Call Print_to_Screen
      > End Sub
      >
      > Private Sub spin_Font_Size_ Change()
      > Call Print_to_Screen
      > End Sub
      >
      > Public Function Get_Data()
      > Dim ExtDB As Database
      > Dim ExtTable As Recordset
      > Dim varRecords As Variant
      > Dim intRcount As Integer
      > Dim intMdayLength As String
      >
      > Set ExtDB =
      > DBEngine.Worksp aces(0).OpenDat abase("S:\TRANS FER\!pics\!Stam ping
      > Program Cell15\!Stampin g
      > Program\Part_Ma rking_Input_2-18-03_102_bldg_200 3.mdb") ' external DB
      > Set ExtTable = ExtDB.OpenRecor dset("tbl_Label _Data") ' external
      > table
      >
      > If ExtTable.Record Count <= 0 Then
      > MsgBox "There is no current data to use"
      > End
      > End If
      >
      > intRcount = ExtTable.Record Count
      > ExtTable.MoveFi rst
      > varRecords = ExtTable.GetRow s(intRcount)
      >
      > If IsNull(varRecor ds(5, 0)) Then
      > intMdayLength = ""
      > Else
      > intMdayLength = "M" & varRecords(5, 0)
      > End If
      >
      > s1 = UCase(varRecord s(1, 0)) & " " & UCase(varRecord s(2, 0)) & " "
      > & UCase(varRecord s(3, 0)) & " " & intMdayLength
      >
      > ExtTable.Close
      > ExtDB.Close
      >
      > End Function
      >
      > Private Sub spin_Rotate_Cha nge()
      >
      > txtRotate_Hidde n = spin_Rotate.Val ue
      > txtRotate_Visib le = txtRotate_Hidde n * 15 & " deg."
      > Call Print_to_Screen
      >
      > End Sub
      >[/color]


      Comment

      • 2D Rick

        #4
        Re: VB6 code converted to VBA / Access2003

        Thanks for the reply.
        My glitch came when trying to send the output directly to the form.
        I think Stephen may have a solution I'm looking at.
        Any other solution are appreciated.
        Rick

        Comment

        • 2D Rick

          #5
          Re: VB6 code converted to VBA / Access2003

          Thanks for the reply.
          I'll look at your class, it sounds like the work around I need.

          Rick

          Comment

          • jimfortune@compumarc.com

            #6
            Re: VB6 code converted to VBA / Access2003

            Stephen Lebans wrote:[color=blue]
            > 1) Access does not expose a handle to a window or control's Device
            > Context(hDC).[/color]

            Stephen,

            Would the GetForegroundWi ndow API function inside the GetDC API
            function allow me to get the handle of the window's device context? If
            so, this could possibly allow subsequent GDI functions to draw in the
            client area of the window.

            James A. Fortune

            Comment

            • david epsom dot com dot au

              #7
              Re: VB6 code converted to VBA / Access2003

              Would he be better off drawing on a Report instead of a Form?

              (david)

              "Stephen Lebans" <ForEmailGotoMy .WebSite.-WWWdotlebansdot ...@linvalid.co m>
              wrote in message news:eUB9f.1171 48$Ph4.3594934@ ursa-nb00s0.nbnet.nb .ca...[color=blue]
              > In taking a quick glance at the code I would say you have two issues.
              >
              > 1) Access does not expose a handle to a window or control's Device
              > Context(hDC).
              >
              > 2) The Access Form object does not expose any drawing methods.
              >
              > If want to get the code up and running quickly then use the vbPictureBox
              > class on my site. It exposes a hDC and supports several drawing methods.
              > http://www.lebans.com/imageclass.htm
              > --
              >
              > HTH
              > Stephen Lebans
              > http://www.lebans.com
              > Access Code, Tips and Tricks
              > Please respond only to the newsgroups so everyone can benefit.
              >
              >
              >
              > "2D Rick" <rbrowniii@comp userve.com> wrote in message
              > news:1130774228 .221650.24110@g 47g2000cwa.goog legroups.com...[color=green]
              >> With the help from members in the VB forum I've pieced together code
              >> that works in VB6 to create radial text similar to "text on a path"
              >> seen in graphics programs.(on a circle only)
              >> I use an Access2003 app to gather the data via a barcode reader which
              >> is then concatenated for the radial text.
              >> Is there any possibility that this code can be converted to run in
              >> Access2003?
              >>
              >>
              >> Option Explicit
              >> Dim dblSpacing As Double
              >> Dim dblRadius As Single
              >> Dim s1 As String
              >> Dim sMarginX As Single
              >> Dim sMarginY As Single
              >>
              >> Private Const LF_FACESIZE = 32
              >> Private Type LOGFONT
              >> lfHeight As Long
              >> lfWidth As Long
              >> lfEscapement As Long
              >> lfOrientation As Long
              >> lfWeight As Long
              >> lfItalic As Byte
              >> lfUnderline As Byte
              >> lfStrikeOut As Byte
              >> lfCharSet As Byte
              >> lfOutPrecision As Byte
              >> lfClipPrecision As Byte
              >> lfQuality As Byte
              >> lfPitchAndFamil y As Byte
              >> lfFaceName As String * LF_FACESIZE
              >> End Type
              >> Private Declare Function CreateFontIndir ect Lib "gdi32" _
              >> Alias "CreateFontIndi rectA" (lpLogFont As LOGFONT) As Long
              >> Private Declare Function SelectObject Lib "gdi32" _
              >> (ByVal hdc As Long, ByVal hObject As Long) As Long
              >> Private Declare Function DeleteObject Lib "gdi32" _
              >> (ByVal hObject As Long) As Long
              >> Private Declare Function TextOut Lib "gdi32" Alias _
              >> "TextOutA" (ByVal hdc As Long, ByVal X As Long, ByVal _
              >> Y As Long, ByVal lpString As String, ByVal nCount _
              >> As Long) As Long
              >> Private Declare Function SetBkMode Lib "gdi32" _
              >> (ByVal hdc As Long, ByVal nBkMode As Long) As Long
              >> Private Declare Function GetTextMetrics Lib "gdi32" _
              >> Alias "GetTextMetrics A" (ByVal hdc As Long, _
              >> lpMetrics As TEXTMETRIC) As Long
              >> Private Type TEXTMETRIC
              >> tmHeight As Long
              >> tmAscent As Long
              >> tmDescent As Long
              >> tmInternalLeadi ng As Long
              >> tmExternalLeadi ng As Long
              >> tmAveCharWidth As Long
              >> tmMaxCharWidth As Long
              >> tmWeight As Long
              >> tmOverhang As Long
              >> tmDigitizedAspe ctX As Long
              >> tmDigitizedAspe ctY As Long
              >> tmFirstChar As Byte
              >> tmLastChar As Byte
              >> tmDefaultChar As Byte
              >> tmBreakChar As Byte
              >> tmItalic As Byte
              >> tmUnderlined As Byte
              >> tmStruckOut As Byte
              >> tmPitchAndFamil y As Byte
              >> tmCharSet As Byte
              >> End Type
              >> Private Const TRANSPARENT = 1
              >> Private Const OPAQUE = 2
              >> Private Const RadToTenthDegre e As Single = 572.957795
              >> Private Const pi = 3.14159
              >> Private myhDC As Long
              >> Private new_font As Long, old_font As Long
              >>
              >>
              >> Private Sub RotateFont(outD evice As Object, angle As Single)
              >> Dim myAngle As Long
              >> myhDC = outDevice.hdc
              >> myAngle = angle * RadToTenthDegre e ' convert from radians
              >> Dim log_font As LOGFONT
              >> With log_font
              >> .lfEscapement = myAngle
              >> .lfOrientation = myAngle
              >> .lfHeight = outDevice.Scale Y(outDevice.Fon t.Size * 20, vbTwips,
              >> vbPixels)
              >> .lfFaceName = outDevice.Font. Name & vbNullChar
              >> If outDevice.Font. Bold = True Then
              >> .lfWeight = 700
              >> Else
              >> .lfWeight = 400
              >> End If
              >> .lfItalic = outDevice.Font. Italic
              >> .lfUnderline = outDevice.Font. Underline
              >> End With
              >> new_font = CreateFontIndir ect(log_font)
              >> old_font = SelectObject(my hDC, new_font)
              >> End Sub
              >>
              >>
              >> Private Sub CircleText(obj As Object, x1 As Single, _
              >> y1 As Single, r1 As Single, s1 As String)
              >> ' add code later to check for valid object type
              >> Dim angle As Single, p As Long, n As Long
              >> Dim xp As Single, yp As Single, position As Single
              >> Dim myhDC As Long, ret As Long
              >> Dim NewFontMetrics As TEXTMETRIC
              >>
              >> obj.ScaleMode = vbInches
              >> p = Len(s1)
              >> angle = (dblSpacing * pi) / p
              >> position = pi * (txtRotate_Hidd en / 12) + 3
              >> myhDC = obj.hdc
              >> For n = 0 To p - 1
              >> xp = x1 - (r1 * Sin(position))
              >> yp = y1 - (r1 * Cos(position))
              >> xp = obj.ScaleX(xp, vbInches, vbPixels)
              >> yp = obj.ScaleY(yp, vbInches, vbPixels)
              >> RotateFont obj, position
              >> GetTextMetrics myhDC, NewFontMetrics ' << NOT obj.hdc
              >>
              >> ' Adjust for variances in font cell height between individual
              >> ' characters by lining up the baselines
              >> xp = xp - NewFontMetrics. tmAscent * Sin(position)
              >> yp = yp - NewFontMetrics. tmAscent * Cos(position)
              >>
              >>
              >> ret = TextOut(myhDC, xp, yp, Mid$(s1, n + 1, 1), 1)
              >> ' change the font back and get rid of the new font
              >> SelectObject myhDC, old_font
              >> DeleteObject new_font
              >> position = position - angle
              >> Next n
              >> End Sub
              >>
              >> Private Sub cmdPrint_Click( )
              >> Printer.Font.Na me = "Courier New"
              >> Printer.Font.Si ze = txt_Font_Size
              >>
              >> Select Case Val(txt_Radius_ Hidden)
              >> Case 1 To 49
              >> sMarginX = 2
              >> sMarginY = 2
              >> Case 50 To 59
              >> sMarginX = 2.5
              >> sMarginY = 2.5
              >> Case 60 To 75
              >> sMarginX = 3
              >> sMarginY = 3
              >> Case 76 To 100
              >> sMarginX = 4
              >> sMarginY = 4
              >> End Select
              >>
              >> ' s1 = "3072670-901 LN05P123 SN050136012345 M555 "
              >> dblSpacing = Len(s1) * (txt_Radial_Spa cing / 1000) + 0.02
              >> Printer.Line (0, 0)-(0, 0), RGB(255, 255, 255), BF
              >> CircleText Printer, sMarginX, sMarginY, txt_Radius_Hidd en / 32, s1
              >> ' CircleText Printer, 2, 2, txt_Radius_Hidd en / 32, s1
              >>
              >> Printer.EndDoc
              >> Call Print_to_Screen
              >>
              >> End Sub
              >>
              >> Public Sub Print_to_Screen ()
              >>
              >> Me.Cls
              >> Me.Print
              >> Me.Font.Name = "Courier New"
              >> Me.Font.Size = txt_Font_Size
              >> Me.FontBold = True
              >> ' s1 = "3072670-901 LN05P123 SN050136012345 M555 "
              >> dblSpacing = Len(s1) * (txt_Radial_Spa cing / 1000) + 0.02
              >> CircleText Me, 4, 4, txt_Radius_Hidd en / 32, s1
              >> DrawWidth = 5
              >> Me.Line (1, 1.5)-(8, 1.5)
              >> Me.Line (1, 1.5)-(1, 8)
              >> End Sub
              >>
              >> Private Sub Form_Activate()
              >> Call Print_to_Screen
              >> End Sub
              >>
              >> Private Sub Form_Load()
              >> txt_Radius_Hidd en = 32
              >> txt_Radial_Spac ing = 30
              >> txt_Font_Size = 10
              >> txt_Radius_Visi ble = txt_Radius_Hidd en / 32
              >> sMarginX = 1
              >> sMarginY = 1
              >>
              >> Call Get_Data
              >> End Sub
              >>
              >> Private Sub spin_Radial_Spa cing_Change()
              >> txt_Radial_Spac ing = spin_Radial_Spa cing.Value
              >> Call Print_to_Screen
              >> End Sub
              >>
              >> Private Sub spin_Radius_Cha nge()
              >> txt_Radius_Hidd en = spin_Radius.Val ue
              >> txt_Radius_Visi ble = Format((txt_Rad ius_Hidden / 32), "0.0000")
              >> Call Print_to_Screen
              >> End Sub
              >>
              >> Private Sub spin_Font_Size_ Change()
              >> Call Print_to_Screen
              >> End Sub
              >>
              >> Public Function Get_Data()
              >> Dim ExtDB As Database
              >> Dim ExtTable As Recordset
              >> Dim varRecords As Variant
              >> Dim intRcount As Integer
              >> Dim intMdayLength As String
              >>
              >> Set ExtDB =
              >> DBEngine.Worksp aces(0).OpenDat abase("S:\TRANS FER\!pics\!Stam ping
              >> Program Cell15\!Stampin g
              >> Program\Part_Ma rking_Input_2-18-03_102_bldg_200 3.mdb") ' external DB
              >> Set ExtTable = ExtDB.OpenRecor dset("tbl_Label _Data") ' external
              >> table
              >>
              >> If ExtTable.Record Count <= 0 Then
              >> MsgBox "There is no current data to use"
              >> End
              >> End If
              >>
              >> intRcount = ExtTable.Record Count
              >> ExtTable.MoveFi rst
              >> varRecords = ExtTable.GetRow s(intRcount)
              >>
              >> If IsNull(varRecor ds(5, 0)) Then
              >> intMdayLength = ""
              >> Else
              >> intMdayLength = "M" & varRecords(5, 0)
              >> End If
              >>
              >> s1 = UCase(varRecord s(1, 0)) & " " & UCase(varRecord s(2, 0)) & " "
              >> & UCase(varRecord s(3, 0)) & " " & intMdayLength
              >>
              >> ExtTable.Close
              >> ExtDB.Close
              >>
              >> End Function
              >>
              >> Private Sub spin_Rotate_Cha nge()
              >>
              >> txtRotate_Hidde n = spin_Rotate.Val ue
              >> txtRotate_Visib le = txtRotate_Hidde n * 15 & " deg."
              >> Call Print_to_Screen
              >>
              >> End Sub
              >>[/color]
              >
              >[/color]


              Comment

              • Stephen Lebans

                #8
                Re: VB6 code converted to VBA / Access2003

                Again the same issue is that neither the Report object nor any of the Access
                intrinsic controls, expose a handle to a permanent Device Context.

                --

                HTH
                Stephen Lebans

                Access Code, Tips and Tricks
                Please respond only to the newsgroups so everyone can benefit.


                "david epsom dot com dot au" <david@epsomdot comdotau> wrote in message
                news:436876ba$0 $66356$c30e37c6 @lon-reader.news.tel stra.net...[color=blue]
                > Would he be better off drawing on a Report instead of a Form?
                >
                > (david)
                >
                > "Stephen Lebans" <ForEmailGotoMy .WebSite.-WWWdotlebansdot ...@linvalid.co m>
                > wrote in message news:eUB9f.1171 48$Ph4.3594934@ ursa-nb00s0.nbnet.nb .ca...[color=green]
                >> In taking a quick glance at the code I would say you have two issues.
                >>
                >> 1) Access does not expose a handle to a window or control's Device
                >> Context(hDC).
                >>
                >> 2) The Access Form object does not expose any drawing methods.
                >>
                >> If want to get the code up and running quickly then use the vbPictureBox
                >> class on my site. It exposes a hDC and supports several drawing methods.
                >> http://www.lebans.com/imageclass.htm
                >> --
                >>
                >> HTH
                >> Stephen Lebans
                >> http://www.lebans.com
                >> Access Code, Tips and Tricks
                >> Please respond only to the newsgroups so everyone can benefit.
                >>
                >>
                >>
                >> "2D Rick" <rbrowniii@comp userve.com> wrote in message
                >> news:1130774228 .221650.24110@g 47g2000cwa.goog legroups.com...[color=darkred]
                >>> With the help from members in the VB forum I've pieced together code
                >>> that works in VB6 to create radial text similar to "text on a path"
                >>> seen in graphics programs.(on a circle only)
                >>> I use an Access2003 app to gather the data via a barcode reader which
                >>> is then concatenated for the radial text.
                >>> Is there any possibility that this code can be converted to run in
                >>> Access2003?
                >>>
                >>>
                >>> Option Explicit
                >>> Dim dblSpacing As Double
                >>> Dim dblRadius As Single
                >>> Dim s1 As String
                >>> Dim sMarginX As Single
                >>> Dim sMarginY As Single
                >>>
                >>> Private Const LF_FACESIZE = 32
                >>> Private Type LOGFONT
                >>> lfHeight As Long
                >>> lfWidth As Long
                >>> lfEscapement As Long
                >>> lfOrientation As Long
                >>> lfWeight As Long
                >>> lfItalic As Byte
                >>> lfUnderline As Byte
                >>> lfStrikeOut As Byte
                >>> lfCharSet As Byte
                >>> lfOutPrecision As Byte
                >>> lfClipPrecision As Byte
                >>> lfQuality As Byte
                >>> lfPitchAndFamil y As Byte
                >>> lfFaceName As String * LF_FACESIZE
                >>> End Type
                >>> Private Declare Function CreateFontIndir ect Lib "gdi32" _
                >>> Alias "CreateFontIndi rectA" (lpLogFont As LOGFONT) As Long
                >>> Private Declare Function SelectObject Lib "gdi32" _
                >>> (ByVal hdc As Long, ByVal hObject As Long) As Long
                >>> Private Declare Function DeleteObject Lib "gdi32" _
                >>> (ByVal hObject As Long) As Long
                >>> Private Declare Function TextOut Lib "gdi32" Alias _
                >>> "TextOutA" (ByVal hdc As Long, ByVal X As Long, ByVal _
                >>> Y As Long, ByVal lpString As String, ByVal nCount _
                >>> As Long) As Long
                >>> Private Declare Function SetBkMode Lib "gdi32" _
                >>> (ByVal hdc As Long, ByVal nBkMode As Long) As Long
                >>> Private Declare Function GetTextMetrics Lib "gdi32" _
                >>> Alias "GetTextMetrics A" (ByVal hdc As Long, _
                >>> lpMetrics As TEXTMETRIC) As Long
                >>> Private Type TEXTMETRIC
                >>> tmHeight As Long
                >>> tmAscent As Long
                >>> tmDescent As Long
                >>> tmInternalLeadi ng As Long
                >>> tmExternalLeadi ng As Long
                >>> tmAveCharWidth As Long
                >>> tmMaxCharWidth As Long
                >>> tmWeight As Long
                >>> tmOverhang As Long
                >>> tmDigitizedAspe ctX As Long
                >>> tmDigitizedAspe ctY As Long
                >>> tmFirstChar As Byte
                >>> tmLastChar As Byte
                >>> tmDefaultChar As Byte
                >>> tmBreakChar As Byte
                >>> tmItalic As Byte
                >>> tmUnderlined As Byte
                >>> tmStruckOut As Byte
                >>> tmPitchAndFamil y As Byte
                >>> tmCharSet As Byte
                >>> End Type
                >>> Private Const TRANSPARENT = 1
                >>> Private Const OPAQUE = 2
                >>> Private Const RadToTenthDegre e As Single = 572.957795
                >>> Private Const pi = 3.14159
                >>> Private myhDC As Long
                >>> Private new_font As Long, old_font As Long
                >>>
                >>>
                >>> Private Sub RotateFont(outD evice As Object, angle As Single)
                >>> Dim myAngle As Long
                >>> myhDC = outDevice.hdc
                >>> myAngle = angle * RadToTenthDegre e ' convert from radians
                >>> Dim log_font As LOGFONT
                >>> With log_font
                >>> .lfEscapement = myAngle
                >>> .lfOrientation = myAngle
                >>> .lfHeight = outDevice.Scale Y(outDevice.Fon t.Size * 20, vbTwips,
                >>> vbPixels)
                >>> .lfFaceName = outDevice.Font. Name & vbNullChar
                >>> If outDevice.Font. Bold = True Then
                >>> .lfWeight = 700
                >>> Else
                >>> .lfWeight = 400
                >>> End If
                >>> .lfItalic = outDevice.Font. Italic
                >>> .lfUnderline = outDevice.Font. Underline
                >>> End With
                >>> new_font = CreateFontIndir ect(log_font)
                >>> old_font = SelectObject(my hDC, new_font)
                >>> End Sub
                >>>
                >>>
                >>> Private Sub CircleText(obj As Object, x1 As Single, _
                >>> y1 As Single, r1 As Single, s1 As String)
                >>> ' add code later to check for valid object type
                >>> Dim angle As Single, p As Long, n As Long
                >>> Dim xp As Single, yp As Single, position As Single
                >>> Dim myhDC As Long, ret As Long
                >>> Dim NewFontMetrics As TEXTMETRIC
                >>>
                >>> obj.ScaleMode = vbInches
                >>> p = Len(s1)
                >>> angle = (dblSpacing * pi) / p
                >>> position = pi * (txtRotate_Hidd en / 12) + 3
                >>> myhDC = obj.hdc
                >>> For n = 0 To p - 1
                >>> xp = x1 - (r1 * Sin(position))
                >>> yp = y1 - (r1 * Cos(position))
                >>> xp = obj.ScaleX(xp, vbInches, vbPixels)
                >>> yp = obj.ScaleY(yp, vbInches, vbPixels)
                >>> RotateFont obj, position
                >>> GetTextMetrics myhDC, NewFontMetrics ' << NOT obj.hdc
                >>>
                >>> ' Adjust for variances in font cell height between individual
                >>> ' characters by lining up the baselines
                >>> xp = xp - NewFontMetrics. tmAscent * Sin(position)
                >>> yp = yp - NewFontMetrics. tmAscent * Cos(position)
                >>>
                >>>
                >>> ret = TextOut(myhDC, xp, yp, Mid$(s1, n + 1, 1), 1)
                >>> ' change the font back and get rid of the new font
                >>> SelectObject myhDC, old_font
                >>> DeleteObject new_font
                >>> position = position - angle
                >>> Next n
                >>> End Sub
                >>>
                >>> Private Sub cmdPrint_Click( )
                >>> Printer.Font.Na me = "Courier New"
                >>> Printer.Font.Si ze = txt_Font_Size
                >>>
                >>> Select Case Val(txt_Radius_ Hidden)
                >>> Case 1 To 49
                >>> sMarginX = 2
                >>> sMarginY = 2
                >>> Case 50 To 59
                >>> sMarginX = 2.5
                >>> sMarginY = 2.5
                >>> Case 60 To 75
                >>> sMarginX = 3
                >>> sMarginY = 3
                >>> Case 76 To 100
                >>> sMarginX = 4
                >>> sMarginY = 4
                >>> End Select
                >>>
                >>> ' s1 = "3072670-901 LN05P123 SN050136012345 M555 "
                >>> dblSpacing = Len(s1) * (txt_Radial_Spa cing / 1000) + 0.02
                >>> Printer.Line (0, 0)-(0, 0), RGB(255, 255, 255), BF
                >>> CircleText Printer, sMarginX, sMarginY, txt_Radius_Hidd en / 32, s1
                >>> ' CircleText Printer, 2, 2, txt_Radius_Hidd en / 32, s1
                >>>
                >>> Printer.EndDoc
                >>> Call Print_to_Screen
                >>>
                >>> End Sub
                >>>
                >>> Public Sub Print_to_Screen ()
                >>>
                >>> Me.Cls
                >>> Me.Print
                >>> Me.Font.Name = "Courier New"
                >>> Me.Font.Size = txt_Font_Size
                >>> Me.FontBold = True
                >>> ' s1 = "3072670-901 LN05P123 SN050136012345 M555 "
                >>> dblSpacing = Len(s1) * (txt_Radial_Spa cing / 1000) + 0.02
                >>> CircleText Me, 4, 4, txt_Radius_Hidd en / 32, s1
                >>> DrawWidth = 5
                >>> Me.Line (1, 1.5)-(8, 1.5)
                >>> Me.Line (1, 1.5)-(1, 8)
                >>> End Sub
                >>>
                >>> Private Sub Form_Activate()
                >>> Call Print_to_Screen
                >>> End Sub
                >>>
                >>> Private Sub Form_Load()
                >>> txt_Radius_Hidd en = 32
                >>> txt_Radial_Spac ing = 30
                >>> txt_Font_Size = 10
                >>> txt_Radius_Visi ble = txt_Radius_Hidd en / 32
                >>> sMarginX = 1
                >>> sMarginY = 1
                >>>
                >>> Call Get_Data
                >>> End Sub
                >>>
                >>> Private Sub spin_Radial_Spa cing_Change()
                >>> txt_Radial_Spac ing = spin_Radial_Spa cing.Value
                >>> Call Print_to_Screen
                >>> End Sub
                >>>
                >>> Private Sub spin_Radius_Cha nge()
                >>> txt_Radius_Hidd en = spin_Radius.Val ue
                >>> txt_Radius_Visi ble = Format((txt_Rad ius_Hidden / 32), "0.0000")
                >>> Call Print_to_Screen
                >>> End Sub
                >>>
                >>> Private Sub spin_Font_Size_ Change()
                >>> Call Print_to_Screen
                >>> End Sub
                >>>
                >>> Public Function Get_Data()
                >>> Dim ExtDB As Database
                >>> Dim ExtTable As Recordset
                >>> Dim varRecords As Variant
                >>> Dim intRcount As Integer
                >>> Dim intMdayLength As String
                >>>
                >>> Set ExtDB =
                >>> DBEngine.Worksp aces(0).OpenDat abase("S:\TRANS FER\!pics\!Stam ping
                >>> Program Cell15\!Stampin g
                >>> Program\Part_Ma rking_Input_2-18-03_102_bldg_200 3.mdb") ' external DB
                >>> Set ExtTable = ExtDB.OpenRecor dset("tbl_Label _Data") ' external
                >>> table
                >>>
                >>> If ExtTable.Record Count <= 0 Then
                >>> MsgBox "There is no current data to use"
                >>> End
                >>> End If
                >>>
                >>> intRcount = ExtTable.Record Count
                >>> ExtTable.MoveFi rst
                >>> varRecords = ExtTable.GetRow s(intRcount)
                >>>
                >>> If IsNull(varRecor ds(5, 0)) Then
                >>> intMdayLength = ""
                >>> Else
                >>> intMdayLength = "M" & varRecords(5, 0)
                >>> End If
                >>>
                >>> s1 = UCase(varRecord s(1, 0)) & " " & UCase(varRecord s(2, 0)) & " "
                >>> & UCase(varRecord s(3, 0)) & " " & intMdayLength
                >>>
                >>> ExtTable.Close
                >>> ExtDB.Close
                >>>
                >>> End Function
                >>>
                >>> Private Sub spin_Rotate_Cha nge()
                >>>
                >>> txtRotate_Hidde n = spin_Rotate.Val ue
                >>> txtRotate_Visib le = txtRotate_Hidde n * 15 & " deg."
                >>> Call Print_to_Screen
                >>>
                >>> End Sub
                >>>[/color]
                >>
                >>[/color]
                >
                >[/color]


                Comment

                • david epsom dot com dot au

                  #9
                  Re: VB6 code converted to VBA / Access2003

                  Isn't the hdc = GetDC(Me.hwnd) valid during the
                  format/print events? I see that pset/line are
                  only valid in the format/print events.

                  But I can't even get pset/line to work.

                  Just interested. This is not a work related question.

                  Regards
                  (david)

                  "Stephen Lebans" <ForEmailGotoMy .WebSite.-WWWdotlebansdot ...@linvalid.co m>
                  wrote in message news:bP2af.1177 08$Ph4.3611227@ ursa-nb00s0.nbnet.nb .ca...[color=blue]
                  > Again the same issue is that neither the Report object nor any of the
                  > Access intrinsic controls, expose a handle to a permanent Device Context.
                  >
                  > --
                  >
                  > HTH
                  > Stephen Lebans
                  > http://www.lebans.com
                  > Access Code, Tips and Tricks
                  > Please respond only to the newsgroups so everyone can benefit.
                  >
                  >
                  > "david epsom dot com dot au" <david@epsomdot comdotau> wrote in message
                  > news:436876ba$0 $66356$c30e37c6 @lon-reader.news.tel stra.net...[color=green]
                  >> Would he be better off drawing on a Report instead of a Form?
                  >>
                  >> (david)
                  >>
                  >> "Stephen Lebans"
                  >> <ForEmailGotoMy .WebSite.-WWWdotlebansdot ...@linvalid.co m> wrote in
                  >> message news:eUB9f.1171 48$Ph4.3594934@ ursa-nb00s0.nbnet.nb .ca...[color=darkred]
                  >>> In taking a quick glance at the code I would say you have two issues.
                  >>>
                  >>> 1) Access does not expose a handle to a window or control's Device
                  >>> Context(hDC).
                  >>>
                  >>> 2) The Access Form object does not expose any drawing methods.
                  >>>
                  >>> If want to get the code up and running quickly then use the vbPictureBox
                  >>> class on my site. It exposes a hDC and supports several drawing methods.
                  >>> http://www.lebans.com/imageclass.htm
                  >>> --
                  >>>
                  >>> HTH
                  >>> Stephen Lebans
                  >>> http://www.lebans.com
                  >>> Access Code, Tips and Tricks
                  >>> Please respond only to the newsgroups so everyone can benefit.
                  >>>
                  >>>
                  >>>
                  >>> "2D Rick" <rbrowniii@comp userve.com> wrote in message
                  >>> news:1130774228 .221650.24110@g 47g2000cwa.goog legroups.com...
                  >>>> With the help from members in the VB forum I've pieced together code
                  >>>> that works in VB6 to create radial text similar to "text on a path"
                  >>>> seen in graphics programs.(on a circle only)
                  >>>> I use an Access2003 app to gather the data via a barcode reader which
                  >>>> is then concatenated for the radial text.
                  >>>> Is there any possibility that this code can be converted to run in
                  >>>> Access2003?
                  >>>>
                  >>>>
                  >>>> Option Explicit
                  >>>> Dim dblSpacing As Double
                  >>>> Dim dblRadius As Single
                  >>>> Dim s1 As String
                  >>>> Dim sMarginX As Single
                  >>>> Dim sMarginY As Single
                  >>>>
                  >>>> Private Const LF_FACESIZE = 32
                  >>>> Private Type LOGFONT
                  >>>> lfHeight As Long
                  >>>> lfWidth As Long
                  >>>> lfEscapement As Long
                  >>>> lfOrientation As Long
                  >>>> lfWeight As Long
                  >>>> lfItalic As Byte
                  >>>> lfUnderline As Byte
                  >>>> lfStrikeOut As Byte
                  >>>> lfCharSet As Byte
                  >>>> lfOutPrecision As Byte
                  >>>> lfClipPrecision As Byte
                  >>>> lfQuality As Byte
                  >>>> lfPitchAndFamil y As Byte
                  >>>> lfFaceName As String * LF_FACESIZE
                  >>>> End Type
                  >>>> Private Declare Function CreateFontIndir ect Lib "gdi32" _
                  >>>> Alias "CreateFontIndi rectA" (lpLogFont As LOGFONT) As Long
                  >>>> Private Declare Function SelectObject Lib "gdi32" _
                  >>>> (ByVal hdc As Long, ByVal hObject As Long) As Long
                  >>>> Private Declare Function DeleteObject Lib "gdi32" _
                  >>>> (ByVal hObject As Long) As Long
                  >>>> Private Declare Function TextOut Lib "gdi32" Alias _
                  >>>> "TextOutA" (ByVal hdc As Long, ByVal X As Long, ByVal _
                  >>>> Y As Long, ByVal lpString As String, ByVal nCount _
                  >>>> As Long) As Long
                  >>>> Private Declare Function SetBkMode Lib "gdi32" _
                  >>>> (ByVal hdc As Long, ByVal nBkMode As Long) As Long
                  >>>> Private Declare Function GetTextMetrics Lib "gdi32" _
                  >>>> Alias "GetTextMetrics A" (ByVal hdc As Long, _
                  >>>> lpMetrics As TEXTMETRIC) As Long
                  >>>> Private Type TEXTMETRIC
                  >>>> tmHeight As Long
                  >>>> tmAscent As Long
                  >>>> tmDescent As Long
                  >>>> tmInternalLeadi ng As Long
                  >>>> tmExternalLeadi ng As Long
                  >>>> tmAveCharWidth As Long
                  >>>> tmMaxCharWidth As Long
                  >>>> tmWeight As Long
                  >>>> tmOverhang As Long
                  >>>> tmDigitizedAspe ctX As Long
                  >>>> tmDigitizedAspe ctY As Long
                  >>>> tmFirstChar As Byte
                  >>>> tmLastChar As Byte
                  >>>> tmDefaultChar As Byte
                  >>>> tmBreakChar As Byte
                  >>>> tmItalic As Byte
                  >>>> tmUnderlined As Byte
                  >>>> tmStruckOut As Byte
                  >>>> tmPitchAndFamil y As Byte
                  >>>> tmCharSet As Byte
                  >>>> End Type
                  >>>> Private Const TRANSPARENT = 1
                  >>>> Private Const OPAQUE = 2
                  >>>> Private Const RadToTenthDegre e As Single = 572.957795
                  >>>> Private Const pi = 3.14159
                  >>>> Private myhDC As Long
                  >>>> Private new_font As Long, old_font As Long
                  >>>>
                  >>>>
                  >>>> Private Sub RotateFont(outD evice As Object, angle As Single)
                  >>>> Dim myAngle As Long
                  >>>> myhDC = outDevice.hdc
                  >>>> myAngle = angle * RadToTenthDegre e ' convert from radians
                  >>>> Dim log_font As LOGFONT
                  >>>> With log_font
                  >>>> .lfEscapement = myAngle
                  >>>> .lfOrientation = myAngle
                  >>>> .lfHeight = outDevice.Scale Y(outDevice.Fon t.Size * 20, vbTwips,
                  >>>> vbPixels)
                  >>>> .lfFaceName = outDevice.Font. Name & vbNullChar
                  >>>> If outDevice.Font. Bold = True Then
                  >>>> .lfWeight = 700
                  >>>> Else
                  >>>> .lfWeight = 400
                  >>>> End If
                  >>>> .lfItalic = outDevice.Font. Italic
                  >>>> .lfUnderline = outDevice.Font. Underline
                  >>>> End With
                  >>>> new_font = CreateFontIndir ect(log_font)
                  >>>> old_font = SelectObject(my hDC, new_font)
                  >>>> End Sub
                  >>>>
                  >>>>
                  >>>> Private Sub CircleText(obj As Object, x1 As Single, _
                  >>>> y1 As Single, r1 As Single, s1 As String)
                  >>>> ' add code later to check for valid object type
                  >>>> Dim angle As Single, p As Long, n As Long
                  >>>> Dim xp As Single, yp As Single, position As Single
                  >>>> Dim myhDC As Long, ret As Long
                  >>>> Dim NewFontMetrics As TEXTMETRIC
                  >>>>
                  >>>> obj.ScaleMode = vbInches
                  >>>> p = Len(s1)
                  >>>> angle = (dblSpacing * pi) / p
                  >>>> position = pi * (txtRotate_Hidd en / 12) + 3
                  >>>> myhDC = obj.hdc
                  >>>> For n = 0 To p - 1
                  >>>> xp = x1 - (r1 * Sin(position))
                  >>>> yp = y1 - (r1 * Cos(position))
                  >>>> xp = obj.ScaleX(xp, vbInches, vbPixels)
                  >>>> yp = obj.ScaleY(yp, vbInches, vbPixels)
                  >>>> RotateFont obj, position
                  >>>> GetTextMetrics myhDC, NewFontMetrics ' << NOT obj.hdc
                  >>>>
                  >>>> ' Adjust for variances in font cell height between individual
                  >>>> ' characters by lining up the baselines
                  >>>> xp = xp - NewFontMetrics. tmAscent * Sin(position)
                  >>>> yp = yp - NewFontMetrics. tmAscent * Cos(position)
                  >>>>
                  >>>>
                  >>>> ret = TextOut(myhDC, xp, yp, Mid$(s1, n + 1, 1), 1)
                  >>>> ' change the font back and get rid of the new font
                  >>>> SelectObject myhDC, old_font
                  >>>> DeleteObject new_font
                  >>>> position = position - angle
                  >>>> Next n
                  >>>> End Sub
                  >>>>
                  >>>> Private Sub cmdPrint_Click( )
                  >>>> Printer.Font.Na me = "Courier New"
                  >>>> Printer.Font.Si ze = txt_Font_Size
                  >>>>
                  >>>> Select Case Val(txt_Radius_ Hidden)
                  >>>> Case 1 To 49
                  >>>> sMarginX = 2
                  >>>> sMarginY = 2
                  >>>> Case 50 To 59
                  >>>> sMarginX = 2.5
                  >>>> sMarginY = 2.5
                  >>>> Case 60 To 75
                  >>>> sMarginX = 3
                  >>>> sMarginY = 3
                  >>>> Case 76 To 100
                  >>>> sMarginX = 4
                  >>>> sMarginY = 4
                  >>>> End Select
                  >>>>
                  >>>> ' s1 = "3072670-901 LN05P123 SN050136012345 M555 "
                  >>>> dblSpacing = Len(s1) * (txt_Radial_Spa cing / 1000) + 0.02
                  >>>> Printer.Line (0, 0)-(0, 0), RGB(255, 255, 255), BF
                  >>>> CircleText Printer, sMarginX, sMarginY, txt_Radius_Hidd en / 32, s1
                  >>>> ' CircleText Printer, 2, 2, txt_Radius_Hidd en / 32, s1
                  >>>>
                  >>>> Printer.EndDoc
                  >>>> Call Print_to_Screen
                  >>>>
                  >>>> End Sub
                  >>>>
                  >>>> Public Sub Print_to_Screen ()
                  >>>>
                  >>>> Me.Cls
                  >>>> Me.Print
                  >>>> Me.Font.Name = "Courier New"
                  >>>> Me.Font.Size = txt_Font_Size
                  >>>> Me.FontBold = True
                  >>>> ' s1 = "3072670-901 LN05P123 SN050136012345 M555 "
                  >>>> dblSpacing = Len(s1) * (txt_Radial_Spa cing / 1000) + 0.02
                  >>>> CircleText Me, 4, 4, txt_Radius_Hidd en / 32, s1
                  >>>> DrawWidth = 5
                  >>>> Me.Line (1, 1.5)-(8, 1.5)
                  >>>> Me.Line (1, 1.5)-(1, 8)
                  >>>> End Sub
                  >>>>
                  >>>> Private Sub Form_Activate()
                  >>>> Call Print_to_Screen
                  >>>> End Sub
                  >>>>
                  >>>> Private Sub Form_Load()
                  >>>> txt_Radius_Hidd en = 32
                  >>>> txt_Radial_Spac ing = 30
                  >>>> txt_Font_Size = 10
                  >>>> txt_Radius_Visi ble = txt_Radius_Hidd en / 32
                  >>>> sMarginX = 1
                  >>>> sMarginY = 1
                  >>>>
                  >>>> Call Get_Data
                  >>>> End Sub
                  >>>>
                  >>>> Private Sub spin_Radial_Spa cing_Change()
                  >>>> txt_Radial_Spac ing = spin_Radial_Spa cing.Value
                  >>>> Call Print_to_Screen
                  >>>> End Sub
                  >>>>
                  >>>> Private Sub spin_Radius_Cha nge()
                  >>>> txt_Radius_Hidd en = spin_Radius.Val ue
                  >>>> txt_Radius_Visi ble = Format((txt_Rad ius_Hidden / 32), "0.0000")
                  >>>> Call Print_to_Screen
                  >>>> End Sub
                  >>>>
                  >>>> Private Sub spin_Font_Size_ Change()
                  >>>> Call Print_to_Screen
                  >>>> End Sub
                  >>>>
                  >>>> Public Function Get_Data()
                  >>>> Dim ExtDB As Database
                  >>>> Dim ExtTable As Recordset
                  >>>> Dim varRecords As Variant
                  >>>> Dim intRcount As Integer
                  >>>> Dim intMdayLength As String
                  >>>>
                  >>>> Set ExtDB =
                  >>>> DBEngine.Worksp aces(0).OpenDat abase("S:\TRANS FER\!pics\!Stam ping
                  >>>> Program Cell15\!Stampin g
                  >>>> Program\Part_Ma rking_Input_2-18-03_102_bldg_200 3.mdb") ' external DB
                  >>>> Set ExtTable = ExtDB.OpenRecor dset("tbl_Label _Data") ' external
                  >>>> table
                  >>>>
                  >>>> If ExtTable.Record Count <= 0 Then
                  >>>> MsgBox "There is no current data to use"
                  >>>> End
                  >>>> End If
                  >>>>
                  >>>> intRcount = ExtTable.Record Count
                  >>>> ExtTable.MoveFi rst
                  >>>> varRecords = ExtTable.GetRow s(intRcount)
                  >>>>
                  >>>> If IsNull(varRecor ds(5, 0)) Then
                  >>>> intMdayLength = ""
                  >>>> Else
                  >>>> intMdayLength = "M" & varRecords(5, 0)
                  >>>> End If
                  >>>>
                  >>>> s1 = UCase(varRecord s(1, 0)) & " " & UCase(varRecord s(2, 0)) & " "
                  >>>> & UCase(varRecord s(3, 0)) & " " & intMdayLength
                  >>>>
                  >>>> ExtTable.Close
                  >>>> ExtDB.Close
                  >>>>
                  >>>> End Function
                  >>>>
                  >>>> Private Sub spin_Rotate_Cha nge()
                  >>>>
                  >>>> txtRotate_Hidde n = spin_Rotate.Val ue
                  >>>> txtRotate_Visib le = txtRotate_Hidde n * 15 & " deg."
                  >>>> Call Print_to_Screen
                  >>>>
                  >>>> End Sub
                  >>>>
                  >>>
                  >>>[/color]
                  >>
                  >>[/color]
                  >
                  >[/color]


                  Comment

                  • Stephen Lebans

                    #10
                    Re: VB6 code converted to VBA / Access2003

                    No. Access only has the ability to return the correct hDC when that
                    particualr control or form has the focus.

                    --

                    HTH
                    Stephen Lebans

                    Access Code, Tips and Tricks
                    Please respond only to the newsgroups so everyone can benefit.


                    "david epsom dot com dot au" <david@epsomdot comdotau> wrote in message
                    news:436ad2b5$0 $66364$c30e37c6 @lon-reader.news.tel stra.net...[color=blue]
                    > Isn't the hdc = GetDC(Me.hwnd) valid during the
                    > format/print events? I see that pset/line are
                    > only valid in the format/print events.
                    >
                    > But I can't even get pset/line to work.
                    >
                    > Just interested. This is not a work related question.
                    >
                    > Regards
                    > (david)
                    >
                    > "Stephen Lebans" <ForEmailGotoMy .WebSite.-WWWdotlebansdot ...@linvalid.co m>
                    > wrote in message news:bP2af.1177 08$Ph4.3611227@ ursa-nb00s0.nbnet.nb .ca...[color=green]
                    >> Again the same issue is that neither the Report object nor any of the
                    >> Access intrinsic controls, expose a handle to a permanent Device Context.
                    >>
                    >> --
                    >>
                    >> HTH
                    >> Stephen Lebans
                    >> http://www.lebans.com
                    >> Access Code, Tips and Tricks
                    >> Please respond only to the newsgroups so everyone can benefit.
                    >>
                    >>
                    >> "david epsom dot com dot au" <david@epsomdot comdotau> wrote in message
                    >> news:436876ba$0 $66356$c30e37c6 @lon-reader.news.tel stra.net...[color=darkred]
                    >>> Would he be better off drawing on a Report instead of a Form?
                    >>>
                    >>> (david)
                    >>>
                    >>> "Stephen Lebans"
                    >>> <ForEmailGotoMy .WebSite.-WWWdotlebansdot ...@linvalid.co m> wrote in
                    >>> message news:eUB9f.1171 48$Ph4.3594934@ ursa-nb00s0.nbnet.nb .ca...
                    >>>> In taking a quick glance at the code I would say you have two issues.
                    >>>>
                    >>>> 1) Access does not expose a handle to a window or control's Device
                    >>>> Context(hDC).
                    >>>>
                    >>>> 2) The Access Form object does not expose any drawing methods.
                    >>>>
                    >>>> If want to get the code up and running quickly then use the
                    >>>> vbPictureBox class on my site. It exposes a hDC and supports several
                    >>>> drawing methods.
                    >>>> http://www.lebans.com/imageclass.htm
                    >>>> --
                    >>>>
                    >>>> HTH
                    >>>> Stephen Lebans
                    >>>> http://www.lebans.com
                    >>>> Access Code, Tips and Tricks
                    >>>> Please respond only to the newsgroups so everyone can benefit.
                    >>>>
                    >>>>
                    >>>>
                    >>>> "2D Rick" <rbrowniii@comp userve.com> wrote in message
                    >>>> news:1130774228 .221650.24110@g 47g2000cwa.goog legroups.com...
                    >>>>> With the help from members in the VB forum I've pieced together code
                    >>>>> that works in VB6 to create radial text similar to "text on a path"
                    >>>>> seen in graphics programs.(on a circle only)
                    >>>>> I use an Access2003 app to gather the data via a barcode reader which
                    >>>>> is then concatenated for the radial text.
                    >>>>> Is there any possibility that this code can be converted to run in
                    >>>>> Access2003?
                    >>>>>
                    >>>>>
                    >>>>> Option Explicit
                    >>>>> Dim dblSpacing As Double
                    >>>>> Dim dblRadius As Single
                    >>>>> Dim s1 As String
                    >>>>> Dim sMarginX As Single
                    >>>>> Dim sMarginY As Single
                    >>>>>
                    >>>>> Private Const LF_FACESIZE = 32
                    >>>>> Private Type LOGFONT
                    >>>>> lfHeight As Long
                    >>>>> lfWidth As Long
                    >>>>> lfEscapement As Long
                    >>>>> lfOrientation As Long
                    >>>>> lfWeight As Long
                    >>>>> lfItalic As Byte
                    >>>>> lfUnderline As Byte
                    >>>>> lfStrikeOut As Byte
                    >>>>> lfCharSet As Byte
                    >>>>> lfOutPrecision As Byte
                    >>>>> lfClipPrecision As Byte
                    >>>>> lfQuality As Byte
                    >>>>> lfPitchAndFamil y As Byte
                    >>>>> lfFaceName As String * LF_FACESIZE
                    >>>>> End Type
                    >>>>> Private Declare Function CreateFontIndir ect Lib "gdi32" _
                    >>>>> Alias "CreateFontIndi rectA" (lpLogFont As LOGFONT) As Long
                    >>>>> Private Declare Function SelectObject Lib "gdi32" _
                    >>>>> (ByVal hdc As Long, ByVal hObject As Long) As Long
                    >>>>> Private Declare Function DeleteObject Lib "gdi32" _
                    >>>>> (ByVal hObject As Long) As Long
                    >>>>> Private Declare Function TextOut Lib "gdi32" Alias _
                    >>>>> "TextOutA" (ByVal hdc As Long, ByVal X As Long, ByVal _
                    >>>>> Y As Long, ByVal lpString As String, ByVal nCount _
                    >>>>> As Long) As Long
                    >>>>> Private Declare Function SetBkMode Lib "gdi32" _
                    >>>>> (ByVal hdc As Long, ByVal nBkMode As Long) As Long
                    >>>>> Private Declare Function GetTextMetrics Lib "gdi32" _
                    >>>>> Alias "GetTextMetrics A" (ByVal hdc As Long, _
                    >>>>> lpMetrics As TEXTMETRIC) As Long
                    >>>>> Private Type TEXTMETRIC
                    >>>>> tmHeight As Long
                    >>>>> tmAscent As Long
                    >>>>> tmDescent As Long
                    >>>>> tmInternalLeadi ng As Long
                    >>>>> tmExternalLeadi ng As Long
                    >>>>> tmAveCharWidth As Long
                    >>>>> tmMaxCharWidth As Long
                    >>>>> tmWeight As Long
                    >>>>> tmOverhang As Long
                    >>>>> tmDigitizedAspe ctX As Long
                    >>>>> tmDigitizedAspe ctY As Long
                    >>>>> tmFirstChar As Byte
                    >>>>> tmLastChar As Byte
                    >>>>> tmDefaultChar As Byte
                    >>>>> tmBreakChar As Byte
                    >>>>> tmItalic As Byte
                    >>>>> tmUnderlined As Byte
                    >>>>> tmStruckOut As Byte
                    >>>>> tmPitchAndFamil y As Byte
                    >>>>> tmCharSet As Byte
                    >>>>> End Type
                    >>>>> Private Const TRANSPARENT = 1
                    >>>>> Private Const OPAQUE = 2
                    >>>>> Private Const RadToTenthDegre e As Single = 572.957795
                    >>>>> Private Const pi = 3.14159
                    >>>>> Private myhDC As Long
                    >>>>> Private new_font As Long, old_font As Long
                    >>>>>
                    >>>>>
                    >>>>> Private Sub RotateFont(outD evice As Object, angle As Single)
                    >>>>> Dim myAngle As Long
                    >>>>> myhDC = outDevice.hdc
                    >>>>> myAngle = angle * RadToTenthDegre e ' convert from radians
                    >>>>> Dim log_font As LOGFONT
                    >>>>> With log_font
                    >>>>> .lfEscapement = myAngle
                    >>>>> .lfOrientation = myAngle
                    >>>>> .lfHeight = outDevice.Scale Y(outDevice.Fon t.Size * 20, vbTwips,
                    >>>>> vbPixels)
                    >>>>> .lfFaceName = outDevice.Font. Name & vbNullChar
                    >>>>> If outDevice.Font. Bold = True Then
                    >>>>> .lfWeight = 700
                    >>>>> Else
                    >>>>> .lfWeight = 400
                    >>>>> End If
                    >>>>> .lfItalic = outDevice.Font. Italic
                    >>>>> .lfUnderline = outDevice.Font. Underline
                    >>>>> End With
                    >>>>> new_font = CreateFontIndir ect(log_font)
                    >>>>> old_font = SelectObject(my hDC, new_font)
                    >>>>> End Sub
                    >>>>>
                    >>>>>
                    >>>>> Private Sub CircleText(obj As Object, x1 As Single, _
                    >>>>> y1 As Single, r1 As Single, s1 As String)
                    >>>>> ' add code later to check for valid object type
                    >>>>> Dim angle As Single, p As Long, n As Long
                    >>>>> Dim xp As Single, yp As Single, position As Single
                    >>>>> Dim myhDC As Long, ret As Long
                    >>>>> Dim NewFontMetrics As TEXTMETRIC
                    >>>>>
                    >>>>> obj.ScaleMode = vbInches
                    >>>>> p = Len(s1)
                    >>>>> angle = (dblSpacing * pi) / p
                    >>>>> position = pi * (txtRotate_Hidd en / 12) + 3
                    >>>>> myhDC = obj.hdc
                    >>>>> For n = 0 To p - 1
                    >>>>> xp = x1 - (r1 * Sin(position))
                    >>>>> yp = y1 - (r1 * Cos(position))
                    >>>>> xp = obj.ScaleX(xp, vbInches, vbPixels)
                    >>>>> yp = obj.ScaleY(yp, vbInches, vbPixels)
                    >>>>> RotateFont obj, position
                    >>>>> GetTextMetrics myhDC, NewFontMetrics ' << NOT obj.hdc
                    >>>>>
                    >>>>> ' Adjust for variances in font cell height between individual
                    >>>>> ' characters by lining up the baselines
                    >>>>> xp = xp - NewFontMetrics. tmAscent * Sin(position)
                    >>>>> yp = yp - NewFontMetrics. tmAscent * Cos(position)
                    >>>>>
                    >>>>>
                    >>>>> ret = TextOut(myhDC, xp, yp, Mid$(s1, n + 1, 1), 1)
                    >>>>> ' change the font back and get rid of the new font
                    >>>>> SelectObject myhDC, old_font
                    >>>>> DeleteObject new_font
                    >>>>> position = position - angle
                    >>>>> Next n
                    >>>>> End Sub
                    >>>>>
                    >>>>> Private Sub cmdPrint_Click( )
                    >>>>> Printer.Font.Na me = "Courier New"
                    >>>>> Printer.Font.Si ze = txt_Font_Size
                    >>>>>
                    >>>>> Select Case Val(txt_Radius_ Hidden)
                    >>>>> Case 1 To 49
                    >>>>> sMarginX = 2
                    >>>>> sMarginY = 2
                    >>>>> Case 50 To 59
                    >>>>> sMarginX = 2.5
                    >>>>> sMarginY = 2.5
                    >>>>> Case 60 To 75
                    >>>>> sMarginX = 3
                    >>>>> sMarginY = 3
                    >>>>> Case 76 To 100
                    >>>>> sMarginX = 4
                    >>>>> sMarginY = 4
                    >>>>> End Select
                    >>>>>
                    >>>>> ' s1 = "3072670-901 LN05P123 SN050136012345 M555 "
                    >>>>> dblSpacing = Len(s1) * (txt_Radial_Spa cing / 1000) + 0.02
                    >>>>> Printer.Line (0, 0)-(0, 0), RGB(255, 255, 255), BF
                    >>>>> CircleText Printer, sMarginX, sMarginY, txt_Radius_Hidd en / 32, s1
                    >>>>> ' CircleText Printer, 2, 2, txt_Radius_Hidd en / 32, s1
                    >>>>>
                    >>>>> Printer.EndDoc
                    >>>>> Call Print_to_Screen
                    >>>>>
                    >>>>> End Sub
                    >>>>>
                    >>>>> Public Sub Print_to_Screen ()
                    >>>>>
                    >>>>> Me.Cls
                    >>>>> Me.Print
                    >>>>> Me.Font.Name = "Courier New"
                    >>>>> Me.Font.Size = txt_Font_Size
                    >>>>> Me.FontBold = True
                    >>>>> ' s1 = "3072670-901 LN05P123 SN050136012345 M555 "
                    >>>>> dblSpacing = Len(s1) * (txt_Radial_Spa cing / 1000) + 0.02
                    >>>>> CircleText Me, 4, 4, txt_Radius_Hidd en / 32, s1
                    >>>>> DrawWidth = 5
                    >>>>> Me.Line (1, 1.5)-(8, 1.5)
                    >>>>> Me.Line (1, 1.5)-(1, 8)
                    >>>>> End Sub
                    >>>>>
                    >>>>> Private Sub Form_Activate()
                    >>>>> Call Print_to_Screen
                    >>>>> End Sub
                    >>>>>
                    >>>>> Private Sub Form_Load()
                    >>>>> txt_Radius_Hidd en = 32
                    >>>>> txt_Radial_Spac ing = 30
                    >>>>> txt_Font_Size = 10
                    >>>>> txt_Radius_Visi ble = txt_Radius_Hidd en / 32
                    >>>>> sMarginX = 1
                    >>>>> sMarginY = 1
                    >>>>>
                    >>>>> Call Get_Data
                    >>>>> End Sub
                    >>>>>
                    >>>>> Private Sub spin_Radial_Spa cing_Change()
                    >>>>> txt_Radial_Spac ing = spin_Radial_Spa cing.Value
                    >>>>> Call Print_to_Screen
                    >>>>> End Sub
                    >>>>>
                    >>>>> Private Sub spin_Radius_Cha nge()
                    >>>>> txt_Radius_Hidd en = spin_Radius.Val ue
                    >>>>> txt_Radius_Visi ble = Format((txt_Rad ius_Hidden / 32), "0.0000")
                    >>>>> Call Print_to_Screen
                    >>>>> End Sub
                    >>>>>
                    >>>>> Private Sub spin_Font_Size_ Change()
                    >>>>> Call Print_to_Screen
                    >>>>> End Sub
                    >>>>>
                    >>>>> Public Function Get_Data()
                    >>>>> Dim ExtDB As Database
                    >>>>> Dim ExtTable As Recordset
                    >>>>> Dim varRecords As Variant
                    >>>>> Dim intRcount As Integer
                    >>>>> Dim intMdayLength As String
                    >>>>>
                    >>>>> Set ExtDB =
                    >>>>> DBEngine.Worksp aces(0).OpenDat abase("S:\TRANS FER\!pics\!Stam ping
                    >>>>> Program Cell15\!Stampin g
                    >>>>> Program\Part_Ma rking_Input_2-18-03_102_bldg_200 3.mdb") ' external DB
                    >>>>> Set ExtTable = ExtDB.OpenRecor dset("tbl_Label _Data") ' external
                    >>>>> table
                    >>>>>
                    >>>>> If ExtTable.Record Count <= 0 Then
                    >>>>> MsgBox "There is no current data to use"
                    >>>>> End
                    >>>>> End If
                    >>>>>
                    >>>>> intRcount = ExtTable.Record Count
                    >>>>> ExtTable.MoveFi rst
                    >>>>> varRecords = ExtTable.GetRow s(intRcount)
                    >>>>>
                    >>>>> If IsNull(varRecor ds(5, 0)) Then
                    >>>>> intMdayLength = ""
                    >>>>> Else
                    >>>>> intMdayLength = "M" & varRecords(5, 0)
                    >>>>> End If
                    >>>>>
                    >>>>> s1 = UCase(varRecord s(1, 0)) & " " & UCase(varRecord s(2, 0)) & " "
                    >>>>> & UCase(varRecord s(3, 0)) & " " & intMdayLength
                    >>>>>
                    >>>>> ExtTable.Close
                    >>>>> ExtDB.Close
                    >>>>>
                    >>>>> End Function
                    >>>>>
                    >>>>> Private Sub spin_Rotate_Cha nge()
                    >>>>>
                    >>>>> txtRotate_Hidde n = spin_Rotate.Val ue
                    >>>>> txtRotate_Visib le = txtRotate_Hidde n * 15 & " deg."
                    >>>>> Call Print_to_Screen
                    >>>>>
                    >>>>> End Sub
                    >>>>>
                    >>>>
                    >>>>
                    >>>
                    >>>[/color]
                    >>
                    >>[/color]
                    >
                    >[/color]


                    Comment

                    Working...