Jump to content
Sign in to follow this  

Open Access Database from a button

Recommended Posts

Hi I'm really new to Autoit and am not sure if this is possible.

I want to open an Access databse or a Word document from a button on a form.

The following code works but i first have to specify which program i want to use to open the document and the location of the program. The trouble is i want the program i am creating to be run on various pc's in my office and they dont all have the same version of Microsoft Office installed. Will i need to write if statement that checks if the path to the program is there if it is open it with that if not move onto the next version location to open. I'll also need to add in a check which says if no versions of the program are found tell the user unable to open the file.

Or can i just open the file and not specify what program to open it with and let the OS decide?

Here is my code...

Func Button1Click()

$LocationAndApplication2OpenWithEXE = "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"

$ItemLocationAndNameToOpen=@WorkingDir &"\FFT\school_FFT_DB_SCH.mdb"

Run('"' & $LocationAndApplication2OpenWithEXE & '" "' & $ItemLocationAndNameToOpen & '"')


Thanks in advance :whistle:

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...