Writing SQL's to automate functions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My biggest weakness to writing in the "computer" language! Please help! How
would I write a procedure to store as a macro to automate the process of
refreshing the data on a linked table. The linked table's name is "Employee
Data Table". The original environment is "F:\CCF\CCF Employee Training
Database - converted". The database that it is linked to is "F:\CCF\CCF ACE
Training Database". Thank you in advanced and thank you so much for the help
you all gave me when I last posted a question about trying to update field
with blank information. Your suggestion of using the unmatched queries was
great.
 
I'm not sure what it is you're looking for. Linked tables shouldn't need
refreshing: they'll automatically show the data in the table to which
they're linked.

If you need to relink the table, you can't do that through a macro.
 
I think the question has to do with a renamed backend
you can use the linked table manager or code like

Public Sub ChangeLink(ByVal NewPath As String)

Dim Db As DAO.Database
Dim TDf As DAO.TableDef

Set Db = Access.CurrentDb()
For Each Tdf In Db.TableDefs
If VBA.Len(Tdf.Connect) > 0 Then
Tdf.Connect = ";DATABASE=" & NewPath
Tdf.Refreshlink
End If
Next

End Sub

HTH

Pieter
 
So you are saying that when I open the second database it will automatically
refresh any of the data that may have been changed on the linked table? I
don't have to go to the linked table manager and refresh everytime I go into
this secondary database.
 
When you have linked tables, they are always "current". All they are are
pointers to the actual table in the other database.
 
Thank you

Douglas J. Steele said:
When you have linked tables, they are always "current". All they are are
pointers to the actual table in the other database.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top