Results 1 to 2 of 2
  1. #1
    yoyo46 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    6

    open file as per field in the table

    guys, i am new in the vb access, i would like open the file (like pdf) as per data in the table (subform) using 1 button command..i am so glad to help me..thankx

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    yoyo46 -

    You stated: "i would like open the file (like pdf) as per data in the table (subform)"...using 1 button command. If the, "as per data in the table (subform)", is a field that contains the file name you want to open and it's address, you could try something like...

    Place a new Button on your form

    Then, in the SUBFORM'S, VBA Current Event, add -

    Private Sub Form_Current()

    'Add in your own error handling

    'Set PDF file Location variable
    dim st1 as string
    st1 = [Forms]![YourFormName]![YourSubformsName].Form![YourControlsNamethatContainstheFileNameandLocation]
    'then, Assign variable to button's HyperlinkAddress Property
    Me![YourButtonName].HyperlinkAddress = st1

    End Sub

    When the button is clicked, the appropriate file should open.

    All the best,

    Jim

Please reply to this thread with any new information or opinions.

Similar Threads

  1. mdb file won't open in Windows 7
    By Nice in forum Access
    Replies: 2
    Last Post: 02-16-2011, 12:42 PM
  2. Replies: 0
    Last Post: 12-03-2010, 02:17 PM
  3. Replies: 4
    Last Post: 09-28-2010, 07:04 PM
  4. Replies: 1
    Last Post: 09-27-2010, 10:10 AM
  5. Can not open File already in use.
    By Wrangler in forum Access
    Replies: 1
    Last Post: 03-04-2009, 09:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums