Results 1 to 5 of 5
  1. #1
    sup8pdct is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    4

    How do I run an external program (shell?) from a form?

    I would like to run an external image viewer program (irfanview) from an Access form. A image file stored in a table will be part of the command eg "i_view.exe c:\comp\xxxxxxxx.jpg /fs /one" where xxxxxxx is the table data.
    I haven't done this type of stuff in access ever so am a real newby with any VBA code. Can someone please give me a real kick in the right direction as to how it can be done?


    James

  2. #2
    Blaise is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Location
    Cape Breton
    Posts
    5
    The Shell command should work for you. First you have to query the table and build the path string "c:\comp\xxxxxxxx.jpg". Then you can use the Shell command with something like this:

    Shell "i_view.exe " & strPath & " /fs /one"

    hth,

    Blaise

  3. #3
    sup8pdct is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    4
    Quote Originally Posted by Blaise View Post
    The Shell command should work for you. First you have to query the table and build the path string "c:\comp\xxxxxxxx.jpg". Then you can use the Shell command with something like this:

    Shell "i_view.exe " & strPath & " /fs /one"

    hth,

    Blaise
    hmmm.
    Will see what I can do. Intend to use it on a form where a score is entered and down arrow pressed to go to next record and to have the pic displayed. Also think will need to set a default value in the table so that when the last record plus 1 is reached, a default pic is displayed so an error doesn't happen. That is if it works that way.
    What about adding a checking statement, say if a yes/no box has a no, the shell command will not be run or if the pic field is blank, the shell command won't run? Again, am a complete dunce when it comes to VBA code as I have never done any.
    James

  4. #4
    Blaise is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Location
    Cape Breton
    Posts
    5
    Hi James,

    If you want to display the picture for each record have you considered using the Image control ? If you have room on your form I think it would be a much cleaner solution than popping up a third party image viewer for each record; you might end up with 30 instances of i_view running. Even if you don't have room you can create another form that just has the Image control on it and load it up instead of calling i_view. Then you have control of where it pops up on the screen, how many instances are running, you can close it when you want to (like if there is no image assoc. to a record).

    That's my 2cents. Have a good day.

    Blaise

  5. #5
    sup8pdct is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    4
    Quote Originally Posted by Blaise View Post
    Hi James,

    If you want to display the picture for each record have you considered using the Image control ? If you have room on your form I think it would be a much cleaner solution than popping up a third party image viewer for each record; you might end up with 30 instances of i_view running. Even if you don't have room you can create another form that just has the Image control on it and load it up instead of calling i_view. Then you have control of where it pops up on the screen, how many instances are running, you can close it when you want to (like if there is no image assoc. to a record).

    That's my 2cents. Have a good day.

    Blaise
    actually, no. I wasn't aware of this part of access. I want the image to show full screen on a digital projector with no borders while having the access form on the lappy screen ie extended desktop.. Iview can do this. the /one option on the command line is to force one instance of iview.The database I am using, I created way back with version 2.0 of access and just update to the next current version of access (2003 atm) When ever I need to use it (mostly once a year). Will look into the image control. Thank you once again.

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

Similar Threads

  1. Shell with Batch Variables
    By robbyaube in forum Programming
    Replies: 2
    Last Post: 12-19-2019, 11:06 AM
  2. populate table w/ external data
    By tlittell in forum Programming
    Replies: 2
    Last Post: 02-20-2010, 08:29 AM
  3. Appending a table with external script
    By farva in forum Import/Export Data
    Replies: 0
    Last Post: 11-09-2009, 12:12 PM
  4. External Data
    By abramenko in forum Import/Export Data
    Replies: 1
    Last Post: 10-14-2009, 12:01 PM
  5. Connect to external .mdb
    By bcobb2350 in forum Programming
    Replies: 8
    Last Post: 10-02-2009, 10:00 AM

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