Add a linked table from another Db using VBA

mattkorguk

Registered User.
Local time
Today, 19:04
Joined
Jun 26, 2007
Messages
301
Hi All,

I have a Db is use and would like to be able to link to another table in another Db, but for this action to be based on a users access level.(The access level is only a 1,2 or 3 in a lookup table)

So basically if they're a "1" then I'd like some VBA to creat a link to this secure table. So then they can add items into the linked table via a form as normal.

I realise I could have the table linked all the time but some users in 2 and 3 level group would not have access to the location where the table is located so you'd receive an error when opening the Db.

Any suggestions alway greatly appreciated.
Thanks.
 
If you can write the conditional statement, try having a look at TableDefs

Will need CreateTableDef, TableDefs.Connect, TableDefs.SourceTableName and Database.TableDefs.Append

To delete the connection at the end of a session, you will need to use DoCmd.DeleteObject
 
Thanks for that, I'll give them a go!
 

Users who are viewing this thread

Back
Top Bottom