Auto refresh tables after query run

sumdumgai

Registered User.
Local time
Today, 18:01
Joined
Jul 19, 2007
Messages
453
Please, what is the VBA command to refresh all Access tables after I have run a query that imports data? Thanks.
 
If you mean to re-query the recordsource of a form/subform for the new records then you can use the Me.Requery vba command to force the form to requery the underlying data.
 
No, what I want is to have all the tables refreshed automatically (instead of doing it manually) just after a query routine has imported data into all the tables. Seems you either have to close the tables and reopen them to see the new records, or you have to hit the 'Refresh All' menu command.
 
Not sure what you mean by query routine. If you set it all up in VBA (using TableDefs) then you should be able to use ...

Code:
CurrentDb().TableDefs.Refresh


-dK
 
When you do the import - where does it go? How would you MANUALLY update the tables if you do it manually? I'm assuming, based on the initial post, that you are importing and then want to use some append or update queries to append or update records in different tables from that imported data. Is that correct?

If so, that is how you would "refresh" your tables - you would need to create a set of append and/or update queries to do the job. You can then have code set up to do the whole process. But we can't make too many suggestions at this point because we don't know what your process to import data is like and where it sends it, etc.
 
I am importing some text files into a number of Access tables using VBA, either appending records or first deleting all records and then adding records. The CurrentDb().TableDefs.Refresh worked. Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom