Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open code not complete before AfterRefresh code begins

Status
Not open for further replies.

JonTebbens

Technical User
Jan 25, 2005
1
US
This bit refreshes the docuemnt on Open. Works fine by itself.

Private Sub Document_Open()
marker = 21
Application.Documents.Item(1).Refresh
marker = 22
end sub

When I add some code to execute AfterRefresh, in order to export the newly refreshed data, I hit the error handler. marker = 21 when it fails. Essentially, it never gets to the following step.

Private Sub Document_AfterRefresh()

If I follow the debug, I end up in the error handler with some undefined object...no surprise there.

If I look at the BO screen, it has not refreshed yet. It still says please wait... If I quit the debugger, the BO screen paints. If I then trigger the code that is supposed to run after refresh, it works fine. There are two data providers, in case that makes any difference. Is the AfterRefresh perhaps kicking off after the first data provider and not waiting until all have completed?

Appreciate any ideas.
Jon Tebbens
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top