Capture database name

dodaman

New member
Local time
Today, 14:17
Joined
Apr 9, 2011
Messages
5
I have a database "X" that imports a table from another database "Y" and I would like to display the name of "Y" in a textbox on a form in "X" so the user would know from whence the table came? Thanks in advance, Dodaman
 
CurrentDb.TableDefs("tableName").Connect will get you the string, you'll need to chop it down a bit with Left/Right/Mid to get it to look nice.

Code:
Mid(CurrentDb.TableDefs("tableName").Connect,InStrRev(CurrentDb.TableDefs("tableName").Connect,"\")+1,99)
will get you close.
 
David,
Thanks so much for your reply, I will get back to this program and give you feedback on what happened; might not be today but I'll let you know.
Bill K
 
David,
I could not get the code to work form me as I am using DAO...but again thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom