How to do Refresh All in MS Access VBA

Hi Team,

I know how to refresh in MS Excel VBA, but not sure what is the code for refresh all in MS Access.
Sandesh555Asked:
Who is Participating?
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Is the table open when you import the data? It shouldn't be, so just close the table before you run the import, then open it:

DoCmd.Close acTable, "YourTableName"

Then after your import:

DoCmd.OpenTable "YourTableName"
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You refresh individual objects in Access. You can refresh a Form like this:

Me.Refresh

Assuming you run that code directly in the form's Code module. You can also refresh a form like this:

Forms("YourFormName").Refresh

Note that "Refresh" is different than "Requery". Requery will entirely rebuild the form's underlying dataset; refresh does NOT, and is therefore used when you are certain that you do NOT need to re-fetch the dataset, but merely to rebuild what you currently have.
0
 
Sandesh555Author Commented:
Basically after i run my code to capture data from Outlook into my access table "MData".  I have to manually refresh the table see number of records.
0
 
Sandesh555Author Commented:
I wnat to stop that....
0
 
Sandesh555Author Commented:
Thanks this helps....
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.