Hi,
I need to create a 'After Update' macro that will add some values to a table in another database.
How can I connect to another database using macro?
Hi,
I need to create a 'After Update' macro that will add some values to a table in another database.
How can I connect to another database using macro?
AFAIK, can't do this with macro, need VBA. Example from my db:
strExtract = gstrBasePath & "Program\Editing\ConstructionExtract.accdb"
'delete records from ConstructionExtract tables
CurrentDb.Execute "DELETE FROM Bituminous IN '" & strExtract & "'"
CurrentDb.Execute "DELETE FROM BituminousMD IN '" & strExtract & "'"
CurrentDb.Execute "DELETE FROM Concrete IN '" & strExtract & "'"
'insert records into ConstructionExtract tables
CurrentDb.Execute "INSERT INTO Bituminous IN '" & strExtract & "' SELECT * FROM ConstructionBIT;"
CurrentDb.Execute "INSERT INTO BituminousMD IN '" & strExtract & "' SELECT * FROM ConstructionBMD;"
CurrentDb.Execute "INSERT INTO Concrete IN '" & strExtract & "' SELECT * FROM ConstructionCONC;"
I haven't tried an UPDATE action but suppose it should work as well.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.