ByteScout BarCode Generator SDK - Microsoft Access - Barcode in Report - ByteScout

ByteScout BarCode Generator SDK – Microsoft Access – Barcode in Report

  • Home
  • /
  • Articles
  • /
  • ByteScout BarCode Generator SDK – Microsoft Access – Barcode in Report

ByteScout BarCode Generator SDK – Microsoft Access – Barcode in Report

Barcode in Report.txt

1. Add reference to "Bytescout Barcode SDK" ActiveX object to your database project (in menu Tools->References).
2. Put Picture object on the Details section of the report.
3. Handle the Format event of the Details section and set barcode image to the Picture control.

Option Compare Database

Dim BarCodeGenerator

Private Sub Report_Open(Cancel As Integer)

    ' Setup the barcode generator
    Set BarCodeGenerator = CreateObject("Bytescout.BarCode.Barcode")
    BarCodeGenerator.RegistrationName = "demo"
    BarCodeGenerator.RegistrationKey = "demo"
    BarCodeGenerator.Symbology = 16 ' QRCode
    
End Sub

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

    ' Set barcode value
    BarCodeGenerator.Value = Me.Field1
    ' Set generated barcode image to Picture object
    Me.BarcodeImage.PictureData = BarCodeGenerator.GetImageBytesPNG()
           
End Sub

Private Sub Report_Close()

    ' Cleanup
    Set BarCodeGenerator = Nothing

End Sub

Reference Error – README.txt

' IMPORTANT: This demo uses VBA so if you have it disabled please temporary enable
' by going to Tools - Macro - Security.. and changing the security mode to ""Medium""
' to Ask if you want enable macro or not. Then close and reopen this Excel document

' You should have evaluation version of the ByteScout SDK installed to get it working - get it from https://bytescout.com

' If you are getting error message like
' "File or assembly named Bytescout SDK, or one of its dependencies, was not found"
' then please try the following:
'
' - Close Excel
' - (for Office 2003 only) download and install this hotfix from Microsoft:
' http://www.microsoft.com/downloads/details.aspx?FamilyId=1B0BFB35-C252-43CC-8A2A-6A64D6AC4670&displaylang=en
'
' and then try again!
'
' If you have any questions please contact us at https://bytescout.com/support/ or at support@bytescout.com
                            


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next