My ultimate goal here is during logon, the user also has a dropdown box where they can select whether to connect to the test tables or the live tables. So I will just write an if statement in vba that will look at which is selected in the drop down box when they click logon and will create the link to the tables in the corresponding external .accdb file containing the tables.
So here is some mocked up code of what I think it may look like;
Private Sub cmdLogon_Click()
if me.cboEnvironment = "Test" then
CreateConnection = "\\sfile0\Data\Inspection\FAIDatabase\Tables\TestTables.accdb", Connect to all Tables"
else
CreateConnection = "\\sfile0\Data\Inspection\FAIDatabase\Tables\Tables.accdb", Connect to all Tables
End if
End
**Oh and I guess I would need to delete the connection to the current tables first?
That's just my theoretical idea of what the code would look like.. I really don't have a clue what the connection vba looks like.
Thanks for your advice and assistance!