VBA & Access: Programmatically connect to ODBC (create shortcut)
I THINK what I want to do should be relatively simple. I have a generic 1-off access database that I use for random requests I receive. I have to constantly connect to the same 2 odbc's. I want to create a VBA shortcut button that I can click to eliminate all of the clicking and password typing I have to do to get in front of my table list.
For example - to connect to an ODBC in Access 2007, I have to do the following steps:
Click "External Data" tab at the top
Click "More"
Click "ODBC Database"
Click "Link to the data source by creating a linked table"
Click "Machine Data Source"
Click the name of the available data source I want (in this case it's called RPT2)
Click OK
Type in user name
Type in password
Click Ok
After all of that, I am in front of my tables. Is there a way to hard code the ODBC to link to and set name and password so I can just click the shortcut button and be in front of my tables?