Refresh Data Button Command

G

Guest

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.
 
G

Guest

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.
 

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

Similar Threads

delete command button 1
Command Button help 4
Delete record error 3
adapted wizard code 5
Command button - copy record 1
Replace standard delete message 3
Delete button problem 1
More help on DMax+1 7

Top