Opening excel files from Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am doing a database system and i want to be able to click a button on a
menu and it will open a specific Excel file. The way my database works is you
enter a job number into a text box click ok and a menu with all the
departments is shown, when you click on a department all the info for that
job is shown. There is information on Excel spreadsheets that i want to show,
i wanted it so when you click a button on the menu it open the excel file for
that job number which will just be the job number.xls e.g 4562.xls but the
other problem is that all the files are contained in seperate folders again
the job number. So the path for a file would be ...\4562\4562.xls. Is is
possible to get it to open the folder with the same name as is in the text
box and open the excel file within it?

Cheers

Danny
 
You can search the forum on open excel

One of the answer will be: use the FollowHyperlink Mehod in the
CommandButton_Click Event.

Check Access VB Help on FollowHyperlink.
==================================
For the second section when you specify the path of sheet to open create the
string with the text box

dim MyDocToOpen as string
MyDocToOpen="c:\MyLocation\" & me.TextBoxName & "\" & me.TextBoxName & ".xls"

and the open using the MyDocToOpen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top