Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a button on an Access form to open a specific form in Excel

Status
Not open for further replies.

csegal

Technical User
Jun 12, 2001
38
US
How do i create a button on an access form to open a specific form in excel?
I have used the tool wizzard to create the button but i can only open excel in a new workbook.
My specific form is:

"C:\My Documents\JW3 NON-ROUTINE FORM.XLS"

Help!!!
Thanks
 
Hi,

Put the following code in the On Click event of the button.

Dim retVal as Variant

retVal = Shell("Excel " & Chr(34) & "C:\My Documents\JW3 NON-ROUTINE FORM.XLS" & Chr(34))

That ought to do it.

Good Luck, dz
dzaccess@yahoo.com
 
YOu can also use the command box wizard and set up a RUNApp. Then enter the pertainent file name as a RUNApp argument. That way a user who is using other than EXCEL to perform an EXCEL function will get the right response also. The registry in your OS will pick the program the user wishes to use on "XLS."

Rollie E
 
That's interesting. Thanks, Rolliee!

I guess it uses the registered file types in Windows. The only problem with this is if the user's system does not have an association set up for "xls", it would barf. Can you make it default to Excel if there's not association set up? dz
dzaccess@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top