Another AppActivate Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Hoping someone can help with this problem:

From within Access XP, I'm trying to open an Explorer window to a particular
network folder and ensure that the new Explorer window moves in front of all
other windows.

The Do-loop I've set up to accomplish this (see below) is one I've seen
recommended in these newsgroups, but I think I'm doing something wrong. The
code opens an Explorer window in the background, its taskbar button
highlighted, but the Access database remains in front and the loop appears to
continue persistently until I manually stop the code.

Thanks in advance for any help.

Matt


Private Sub cmdShare_Click()
Dim varID As Variant

varID = Shell("Explorer /e,/root,\\server\vol\Data\Share", vbNormalFocus)

On Error Resume Next

Do
Err.Clear
AppActivate varID
MsgBox Err.Number
Loop Until Err.Number = 0


End Sub
 
FYI, the MsgBox line within the Do-loop is extraneous. When it is removed,
the Do-loop still continues without end.
 
Back
Top