Full Version: Linking Be
UtterAccess Discussion Forums > Microsoft® Access > Access Q and A
expatriate
Hi,

Can anyone point me to some sample code for linking to Access tables, Excel worksheets and text files? The names, paths would be stored in a table.

Thanks,

Peter
Doug Steele
To relink tables, check Relink Access tables from code at "The Access Web".

To relink workbooks or text files, delete the existing linked tables and use TransferSpreadsheet or TransferText to create new linked tables.
CyberCow
As an alternative, Relink / Swap Between Live, TEST and Local Data may provide a flexible solution for you.

hope this helps
expatriate
QUOTE (CyberCow @ May 6 2012, 08:42 AM) *
As an alternative, Relink / Swap Between Live, TEST and Local Data may provide a flexible solution for you.

hope this helps


That looks like what I need - I'll give it a try.

Thank you.
expatriate
QUOTE (CyberCow @ May 6 2012, 08:42 AM) *
As an alternative, Relink / Swap Between Live, TEST and Local Data may provide a flexible solution for you.

hope this helps


One thing - I had to modify the code from "mdb" to "accdb". Also, I do not understand the "use" checkbox. Could you explain that?

Thanks,

Peter
CyberCow
Peter,

The "Use" check box means that if the item is checked, it WILL be relinked. I added that feature to keep a list of tables or other sources that were not always used. So, if you want the table to be re-linked, be sur ethe "Use" checkbox is ticked. Otherwise, the referenced table will not be linked at re-link time.
expatriate
It was probably a silly question but I did not see it referenced in the code. I guess it must be there somewhere. OK - I will modify it to be checked by default otherwise the user will have to check 300 checkboxes!

Thanks,

Peter
CyberCow
Hmmm, you may be right and the "Use" box may not be utilized in that specific version. You can ignore it, make it invisible or remove it all together. Or, you could set it's default value to "True" and so on and so forth. It's highly customizable and does not need to make a user check every box every time.

Please feel free to roam about the code with your imagination and have your way with it.
expatriate
QUOTE (CyberCow @ May 6 2012, 08:20 PM) *
Hmmm, you may be right and the "Use" box may not be utilized in that specific version. You can ignore it, make it invisible or remove it all together. Or, you could set it's default value to "True" and so on and so forth. It's highly customizable and does not need to make a user check every box every time.

Please feel free to roam about the code with your imagination and have your way with it.


It's working great once I adjusted the code to look for an accdb back end. I think it needs something like a find and replace function for the connection string - I will add that. It's really nicely done. Looks great and is so easy to customize to add transfer spreadsheet and transfertext commands as well. No other relinking code or interface I have come across has provision for other than database tables. Good one, mate!
CyberCow
Glad you like it and that we could help.

Good luck with your projects!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.