I have a module in my database named "modScanner" to scan items into the database.
Here is the module code:
Option Compare Database
Option Explicit
Public Sub GetImage()
Dim FileLocation As String
Dim diagFile As FileDialog
Set diagFile = Application.FileDialog(msoFileDialogSaveAs)
diagFile.Title = "Save PDF File As..."
diagFile.InitialFileName = "*.pdf"
If diagFile.Show Then
FileLocation = diagFile.SelectedItems(1)
Dim scanDiag As Object
Dim image As Object
Set scanDiag = CreateObject("WIA.CommonDialog")
Set image = CreateObject("WIA.ImageFile")
Set image = scanDiag.ShowAcquireImage()
image.SaveFile FileLocation
End If
End Sub
How do I get the module to run when clicking a cmd button?
Thank you in advance for any help.