test for "Table Open" not working when filter applied to table

  • Thread starter JABCCS via AccessMonster.com
  • Start date
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?
 
S

Stefan Hoffmann

hi,
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:
Take a llok at the ten commandments:

http://www.mvps.org/access/tencommandments.htm

Just create a form to view it in datasheet view and use

DoCmd.OpenForm FormName:="Form",WindowMode:=acDialog

The acDialog will stop code execution at the DoCmd as long as the form
is open.


mfG
--> stefan <--
 
J

JABCCS via AccessMonster.com

Thanks Stefan

I know I violated Commandment #2. :)

This is a quick and dirty application but was hoping to build in some basic
controls without investing the extra time to build the form. I can be
convinced though.

john
 

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


Top