Consulting

Results 1 to 3 of 3

Thread: Selected Listbox item passed to Web image control to display a pdf document

  1. #1
    VBAX Regular
    Joined
    Jul 2017
    Posts
    18
    Location

    Selected Listbox item passed to Web image control to display a pdf document

    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

  2. #2
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    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

  3. #3
    VBAX Regular
    Joined
    Jul 2017
    Posts
    18
    Location
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •