J
JABCCS via AccessMonster.com
Hi all,
In a VB subroutine, I need to open a table in dataview, pause until the table
is closed by the operator, then execute some other code. Here's the code I'm
using:
DoCmd.OpenTable "tblProjectBudgets"
'Pause until budget table is closed
Do While (SysCmd(acSysCmdGetObjectState, lngObjType, "tblProjectBudgets") =
acObjStateOpen)
DoEvents
Loop
This code works with one exception. If the operator applies a filter to the
table while viewing/changing it this apparently closes and reopens the table
because I fall out of the Do While routine, and the code continues from there,
even though the table is still open.
I tried adding a second Open Object test after the first one and executing a
GoTo above the first Do While if the table was open but that didn't work.
Any ideas?
In a VB subroutine, I need to open a table in dataview, pause until the table
is closed by the operator, then execute some other code. Here's the code I'm
using:
DoCmd.OpenTable "tblProjectBudgets"
'Pause until budget table is closed
Do While (SysCmd(acSysCmdGetObjectState, lngObjType, "tblProjectBudgets") =
acObjStateOpen)
DoEvents
Loop
This code works with one exception. If the operator applies a filter to the
table while viewing/changing it this apparently closes and reopens the table
because I fall out of the Do While routine, and the code continues from there,
even though the table is still open.
I tried adding a second Open Object test after the first one and executing a
GoTo above the first Do While if the table was open but that didn't work.
Any ideas?