Refresh Data Button Command

J

JohnLute

I have a refresh data button in my form header. I'd like it to refresh
everything including the subforms, however, the subforms aren't refreshing.
What can I add to the following code in order to achieve this?

Thanks in advance!

Private Sub cmdFGRefresh_Click()
On Error GoTo Err_cmdFGRefresh_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

Exit_cmdFGRefresh_Click:
Exit Sub

Err_cmdFGRefresh_Click:
MsgBox Err.Description
Resume Exit_cmdFGRefresh_Click

End Sub
 
V

Vimal Ori

do you need/want to refresh or requery?
me.refresh or me.requery should do the trick.

Have a look at Access /online help which provides with clear details about
the difference between refresh and requery.
 
J

JohnLute

Thanks, Vimal. I reviewed the help files and found that I can also refresh
from RECORDS toolbar. I think I'll just use this function and eliminate the
button from the design for the sake of simplicity.
 
Top