Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Relink Tables    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Link tables
Simon Levesque 
     
3 years ago
In my DB, the user creates a new table with vba code and the link is properly created in the backend file for this new table that is also stored in the BE file. Everything works fine. Each user creates tables like this from their own ACCDE file but my problem is that I would like to link all tables from the backend when my main menu form load so each user will have access to all the tables. Ive tried the code in the video (For each td...) but I think it isn't working because it assumes that the tables name are in the frontend and it just need to relink. My problem is to look in the backend and make sure that all new tables are stored in the frontend as linked tables. Any ideas?
Kevin Yip  @Reply  
     
3 years ago
You have to check all the BE tables one by one and see if they are all linked in the FE.  There is no shortcut, I'm afraid, but the code may not be too bad.  Get a list of all the tables in the BE (using a TableDef loop, for instance).  Then on the FE, use OpenRecordset to check if each BE table exists (i.e. is linked):

    Dim r As Recordset
    Set r = CurrentDb.OpenRecordset("BE table name")

If the above returns an error, that means the BE table doesn't exist (i.e. isn't linked) in the FE.  In that case, you link this BE table in your FE with:

    DoCmd.TransferDatabase acLink, "Microsoft Access", "C:\My Documents\BE.accdb", acTable, "BE table name", "FE table name"

Use a loop to do this for all the BE tables.  

If you have a lot (hundreds) of BE tables, this process could be slow.  If tables are frequently added, I suggest you log every addition in a table, so you have a list of newly added tables.  Otherwise, you have to look up BE tables one by one every time to find out which are new.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Relink Tables.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 8/8/2026 3:12:48 PM. PLT: 1s