I have an Access program that is as FE and my database is SQL as BE. When I update and send my Access program to my clients, they get the updated version and copy it on their Pc. For the first time before logging in, they press a button that relinks the tables to database. The information of the connection string is in a table in their database. My code for relinking is quite simple but it has a bug. If all the tables in FE be present in BE there is no problem. But if there was a linked table in FE that doesn't be in BE, an error occurs and the relinking process fails.
How can I check that a table have a corresponding counterpart in BE and if it hasn't a corresponding table the code escapes it and continue to other tables?
And if the process was successful show a message.
For Each td In db.TableDefs
If td.Connect <> "" Then
Set td = db.TableDefs(td.Name)
td.Connect = strConnection
td.RefreshLink
End If
Next