PDA

View Full Version : Selected Listbox item passed to Web image control to display a pdf document



Oblio
09-01-2017, 02:32 PM
The goal is to make data entry fast ( as in image loading ) and convenient.

Paper forms containing hand written form field responses are scanned and saved as a .pdf.

We would like to select the forms named 01.pdf for data entry. I have created a query which returns these files pathways, named q_MCR_Pathways_Extended, and the bound field is t_files_ID.

I was wondering if there is a standard way to do this?

If I created a form bound to a table named t_MCRs with the fields of data I need to extract from the .pdf, had a Listbox control with the above query as its record source and multiselect set to false, how would I pass the currently selected item in the Listbox to be the Web image controls record source so that particular .pdf could be data entered on the form.

BTW, MCR is the name of the form and contains details of a students performance on a test.

Any samples or ideas would be sincerely appreciated...

Thanks,


Will

OBP
09-01-2017, 03:24 PM
I created this to print .pdf files from a folder.
It might be a starting place for you.


Dim CheckFile As String, FileFound As String, sDest As String, FileName As String, x As Long, sAcrobatReaderExe As String

CheckFile = "*.pdf"
On Error GoTo errorcatch

'The following lines of code use a network path for the source file :
sDest = "C:\Users\A C\Downloads\" & CheckFile ' will be changed to CurrentProject.path & MAXIMOExports
'MsgBox sDest
ctr = 1
FileFound = Dir(sDest) ' Retrieving the first entry.
FileName = "C:\Users\A C\Downloads\" & FileFound
If FileFound <> "" Then
MsgBox ctr & " - " & FileName
CreateObject("Shell.Application").Namespace(0).ParseName(FileName).InvokeVerb ("Print")
End If

Do Until FileFound = "" ' Start the loop.
ctr = ctr + 1
FileFound = Dir() ' Getting next entry.
If FileFound <> "" Then
MsgBox ctr & " - " & FileFound
CreateObject("Shell.Application").Namespace(0).ParseName(FileName).InvokeVerb ("Print")
End If
Loop
MsgBox ctr & " .pdf files printed"
Exit Sub
errorcatch:

MsgBox "Error - " & Err.Description

Oblio
09-01-2017, 04:25 PM
Super! I will see what I can do with this tonight and will get back to this thread if I have any success and/or failure.

Thanks very much for the help and I hope you are having a nice weekend!

Bill