Advanced Filter/Sort within VBA code

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

Guest

In the On Click event of a command button, I have several lines of code. In the middle of that code, this line open
the Advanced Filter/Sort grid

DoCmd.RunCommand acCmdAdvancedFilterSor

After that line, there are about 15 lines of additional code in the event procedure

Up through that line, the code works perfectly. However, when the user completes the grid and clicks the Apply Filter button in the toolbar, the filter works fine, bu
everything stops because the remainder of the VBA code does not run

How can I get the code to continue after the user clicks the Apply Filter button?
 
Post the code for people to take a look at, it will increase the chance that
we can help.
Just a wild guess, but is it possible the code after the RunCommand call is
executing while the filter dialog is up? Is it actually stopping on the
RunCommand call and doing the operation modally?
--
Bryan Reich
Microsoft Office
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


Paul D. Simon said:
In the On Click event of a command button, I have several lines of code.
In the middle of that code, this line opens
the Advanced Filter/Sort grid:

DoCmd.RunCommand acCmdAdvancedFilterSort

After that line, there are about 15 lines of additional code in the event procedure.

Up through that line, the code works perfectly. However, when the user
completes the grid and clicks the Apply Filter button in the toolbar, the
filter works fine, but
everything stops because the remainder of the VBA code does not run.

How can I get the code to continue after the user clicks the Apply Filter
button?
 
Back
Top