You can use Debenu Quick PDF Library with Microsoft Access and Visual Basic using either the DLL or ActiveX editions.

There is also a knowledge base article which shows you how to generate a PDF report from a Microsoft Access database using C# and Debenu Quick PDF Library.

Included below is a sample demonstrating how to use the ActiveX edition of Debenu Quick PDF Library with Microsoft Access and Visual Basic.

Note: you will need to register the ActiveX edition of Debenu Quick PDF Library via the command prompt before you proceed.

regsvr32.exe “C:\Program Files\Debenu\PDF Library\ActiveX\DebenuPDFLibraryAX1011.dll”

Then you will need to add the ActiveX component that you’ve just registered as a reference to your Microsoft Access project.

Private Sub Command2_Click()
Dim ClassName
Dim LicenseKey
Dim FileName
 
ClassName = "DebenuPDFLibraryAX1011.PDFLibrary"
LicenseKey = "..."
FileName = "1.hello-world.pdf"
 
Dim QP
Dim Result
 
Set QP = CreateObject(ClassName)
MsgBox ("Library version: " + QP.LibraryVersion)
Result = QP.UnlockKey(LicenseKey)
If Result = 1 Then
  MsgBox ("Valid license key: " + QP.LicenseInfo)
  Call QP.DrawText(100, 500, "Hello world from MS Access")
 
  If QP.SaveToFile(FileName) = 1 Then
    MsgBox ("File " + FileName + " written successfully")
  Else
    MsgBox ("Error, file could not be written")
  End If
Else
  MsgBox ("- Invalid license key -")
  MsgBox ("Please set your license key by editing this file")
End If
 
Set QP = Nothing
 
End Sub

ClassName = "DebenuPDFLibraryAX1011.PDFLibrary"
LicenseKey = "..."
FileName = "1.hello-world.pdf"

Dim QP
Dim Result

Set QP = CreateObject(ClassName)
MsgBox ("Library version: " + QP.LibraryVersion)
Result = QP.UnlockKey(LicenseKey)
If Result = 1 Then
MsgBox ("Valid license key: " + QP.LicenseInfo)
Call QP.DrawText(100, 500, "Hello world from MS Access")

If QP.SaveToFile(FileName) = 1 Then
MsgBox ("File " + FileName + " written successfully")
Else
MsgBox ("Error, file could not be written")
End If
Else
MsgBox ("- Invalid license key -")
MsgBox ("Please set your license key by editing this file")
End If

Set QP = Nothing

End Sub