halt processing 
Author Message
 halt processing

In my VBA, I do some stuff to populate a temp table.

I then open up a form using that temp table for editing.

Then, the code is supposed to contine, using the newly
updated/changed/added/ date in the temp table to repopulate another table.

Problem is, the code keeps running right past the docmd.openform line!

So the changes made via the form are all ignored.

How to fix?
--
Bill

PhotoSourceFolio webmaster
http://www.*-*-*.com/



Sun, 24 Aug 2003 08:44:48 GMT  
 halt processing
I've also just discovered that if the docmd.openform statement is between a
ws.begintrans and ws.commitrans, that the form won't even open up!

Why?

--
Bill

PhotoSourceFolio webmaster
http://www.photosourcefolio.com


Quote:
> In my VBA, I do some stuff to populate a temp table.

> I then open up a form using that temp table for editing.

> Then, the code is supposed to contine, using the newly
> updated/changed/added/ date in the temp table to repopulate another table.

> Problem is, the code keeps running right past the docmd.openform line!

> So the changes made via the form are all ignored.

> How to fix?
> --
> Bill

> PhotoSourceFolio webmaster
> http://www.photosourcefolio.com



Sun, 24 Aug 2003 09:07:14 GMT  
 halt processing
If you add the following function to your module:
Function IsLoaded(ByVal strFormName As String) As Integer
 ' Returns True if the specified form is open in Form view or Datasheet
view.

    Const conObjStateClosed = 0
    Const conDesignView = 0

    If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <>
conObjStateClosed Then
        If Forms(strFormName).CurrentView <> conDesignView Then
            IsLoaded = True
        End If
    End If
Then, after you open the form you can put the following code to have the
routine that opened the form sit and wait
    Do While IsLoaded("FormName")
        DoEvents
    Loop
Your routine will stay in the Do While loop until the form is closed
(DoEvents yields execution so that the operating system can process other
events).

Hope this helps,
Dom Cassone


Quote:
> In my VBA, I do some stuff to populate a temp table.

> I then open up a form using that temp table for editing.

> Then, the code is supposed to contine, using the newly
> updated/changed/added/ date in the temp table to repopulate another table.

> Problem is, the code keeps running right past the docmd.openform line!

> So the changes made via the form are all ignored.

> How to fix?
> --
> Bill

> PhotoSourceFolio webmaster
> http://www.photosourcefolio.com



Sun, 24 Aug 2003 10:31:19 GMT  
 halt processing
If you want the code to stop after issuing the OpenForm call, and continue
only after the form is closed, you have to open the form in dialog mode.
See the help file on the OpenForm method for details, but I think the syntax
would be something like

    DoCmd.OpenForm "frmMyForm",WindowMode:=acDialog

--

Dirk Goldgar
(to reply via email, remove NOSPAM from address)

Quote:

>In my VBA, I do some stuff to populate a temp table.

>I then open up a form using that temp table for editing.

>Then, the code is supposed to contine, using the newly
>updated/changed/added/ date in the temp table to repopulate another table.

>Problem is, the code keeps running right past the docmd.openform line!

>So the changes made via the form are all ignored.

>How to fix?
>--
>Bill

>PhotoSourceFolio webmaster
>http://www.photosourcefolio.com



Sun, 24 Aug 2003 10:40:38 GMT  
 halt processing
Well, good news and bad news.

The bad news is that it doesn't work IF it's in a
ws.begintrans/ws.committrans code section.  It works OK if I comment out the
ws.begintrans.

I feel I really need that transaction tracking to ensure the tables don't
get out of sync, but nothing much other than sql commands seems to work in
those sections.

Is that by design, or am I doing something wrong?

Thanks.

--
Bill

PhotoSourceFolio webmaster
http://www.photosourcefolio.com


Quote:
> If you add the following function to your module:
> Function IsLoaded(ByVal strFormName As String) As Integer
>  ' Returns True if the specified form is open in Form view or Datasheet
> view.

>     Const conObjStateClosed = 0
>     Const conDesignView = 0

>     If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <>
> conObjStateClosed Then
>         If Forms(strFormName).CurrentView <> conDesignView Then
>             IsLoaded = True
>         End If
>     End If
> Then, after you open the form you can put the following code to have the
> routine that opened the form sit and wait
>     Do While IsLoaded("FormName")
>         DoEvents
>     Loop
> Your routine will stay in the Do While loop until the form is closed
> (DoEvents yields execution so that the operating system can process other
> events).

> Hope this helps,
> Dom Cassone



> > In my VBA, I do some stuff to populate a temp table.

> > I then open up a form using that temp table for editing.

> > Then, the code is supposed to contine, using the newly
> > updated/changed/added/ date in the temp table to repopulate another
table.

> > Problem is, the code keeps running right past the docmd.openform line!

> > So the changes made via the form are all ignored.

> > How to fix?
> > --
> > Bill

> > PhotoSourceFolio webmaster
> > http://www.photosourcefolio.com



Sun, 24 Aug 2003 10:55:31 GMT  
 halt processing
Also, as I kinda suspected, this method causes the computer to shoot to 100%
utilization while in the loop.

--
Bill

PhotoSourceFolio webmaster
http://www.photosourcefolio.com


Quote:
> If you add the following function to your module:
> Function IsLoaded(ByVal strFormName As String) As Integer
>  ' Returns True if the specified form is open in Form view or Datasheet
> view.

>     Const conObjStateClosed = 0
>     Const conDesignView = 0

>     If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <>
> conObjStateClosed Then
>         If Forms(strFormName).CurrentView <> conDesignView Then
>             IsLoaded = True
>         End If
>     End If
> Then, after you open the form you can put the following code to have the
> routine that opened the form sit and wait
>     Do While IsLoaded("FormName")
>         DoEvents
>     Loop
> Your routine will stay in the Do While loop until the form is closed
> (DoEvents yields execution so that the operating system can process other
> events).

> Hope this helps,
> Dom Cassone



> > In my VBA, I do some stuff to populate a temp table.

> > I then open up a form using that temp table for editing.

> > Then, the code is supposed to contine, using the newly
> > updated/changed/added/ date in the temp table to repopulate another
table.

> > Problem is, the code keeps running right past the docmd.openform line!

> > So the changes made via the form are all ignored.

> > How to fix?
> > --
> > Bill

> > PhotoSourceFolio webmaster
> > http://www.photosourcefolio.com



Sun, 24 Aug 2003 11:45:33 GMT  
 halt processing
Group,

Shouldn't he be able to open the form  as a MODAL form?  That should stop
all processing until he closes the form and it won't utilize all of the
memory.

I have a Visual Basic Application that does this.

VBNovice


Quote:
> If you want the code to stop after issuing the OpenForm call, and continue
> only after the form is closed, you have to open the form in dialog mode.
> See the help file on the OpenForm method for details, but I think the
syntax
> would be something like

>     DoCmd.OpenForm "frmMyForm",WindowMode:=acDialog

> --

> Dirk Goldgar
> (to reply via email, remove NOSPAM from address)


> >In my VBA, I do some stuff to populate a temp table.

> >I then open up a form using that temp table for editing.

> >Then, the code is supposed to contine, using the newly
> >updated/changed/added/ date in the temp table to repopulate another
table.

> >Problem is, the code keeps running right past the docmd.openform line!

> >So the changes made via the form are all ignored.

> >How to fix?
> >--
> >Bill

> >PhotoSourceFolio webmaster
> >http://www.photosourcefolio.com



Mon, 25 Aug 2003 08:13:38 GMT  
 halt processing
That's what opening it with WindowMode:=acDialog does.

--

Dirk Goldgar
(to reply via email, remove NOSPAM from address)

Quote:

>Group,

>Shouldn't he be able to open the form  as a MODAL form?  That should stop
>all processing until he closes the form and it won't utilize all of the
>memory.

>I have a Visual Basic Application that does this.

>VBNovice



>> If you want the code to stop after issuing the OpenForm call, and
continue
>> only after the form is closed, you have to open the form in dialog mode.
>> See the help file on the OpenForm method for details, but I think the
>syntax
>> would be something like

>>     DoCmd.OpenForm "frmMyForm",WindowMode:=acDialog

>> --

>> Dirk Goldgar
>> (to reply via email, remove NOSPAM from address)


>> >In my VBA, I do some stuff to populate a temp table.

>> >I then open up a form using that temp table for editing.

>> >Then, the code is supposed to contine, using the newly
>> >updated/changed/added/ date in the temp table to repopulate another
>table.

>> >Problem is, the code keeps running right past the docmd.openform line!

>> >So the changes made via the form are all ignored.

>> >How to fix?
>> >--
>> >Bill

>> >PhotoSourceFolio webmaster
>> >http://www.photosourcefolio.com



Mon, 25 Aug 2003 14:26:25 GMT  
 halt processing
Boy, did that ever fail!

the form only popped on the screen ever so briefly and then disappeared!

I used this:

    DoCmd.OpenForm "tbl_Special", acFormDS, , , , acDialog

--
Bill

PhotoSourceFolio webmaster
http://www.photosourcefolio.com


Quote:
> Group,

> Shouldn't he be able to open the form  as a MODAL form?  That should stop
> all processing until he closes the form and it won't utilize all of the
> memory.

> I have a Visual Basic Application that does this.

> VBNovice



> > If you want the code to stop after issuing the OpenForm call, and
continue
> > only after the form is closed, you have to open the form in dialog mode.
> > See the help file on the OpenForm method for details, but I think the
> syntax
> > would be something like

> >     DoCmd.OpenForm "frmMyForm",WindowMode:=acDialog

> > --

> > Dirk Goldgar
> > (to reply via email, remove NOSPAM from address)


> > >In my VBA, I do some stuff to populate a temp table.

> > >I then open up a form using that temp table for editing.

> > >Then, the code is supposed to contine, using the newly
> > >updated/changed/added/ date in the temp table to repopulate another
> table.

> > >Problem is, the code keeps running right past the docmd.openform line!

> > >So the changes made via the form are all ignored.

> > >How to fix?
> > >--
> > >Bill

> > >PhotoSourceFolio webmaster
> > >http://www.photosourcefolio.com



Tue, 26 Aug 2003 02:57:49 GMT  
 halt processing
I'm not sure, but the problem may be with your use of acFormDS.  I'm using
Access 97, not A2K, but when I use acFormDS and WindowMode:=acDialog
together, the form opens modal, but in normal, single-form view, not in
datasheet view.  That suggests to me that it may not be possible to open a
form both modal and in datasheet view, and that A2K may be failing where A97
just substituted a different view.  Either that, or there's some code on
your form forcing an immediate closing.

Try opening the form with acDialog, but in normal view instead of datasheet.
Does it open properly then?

--

Dirk Goldgar
(remove NOSPAM from reply address)


Quote:
> Boy, did that ever fail!

> the form only popped on the screen ever so briefly and then disappeared!

> I used this:

>     DoCmd.OpenForm "tbl_Special", acFormDS, , , , acDialog

> --
> Bill

> PhotoSourceFolio webmaster
> http://www.photosourcefolio.com



> > Group,

> > Shouldn't he be able to open the form  as a MODAL form?  That should
stop
> > all processing until he closes the form and it won't utilize all of the
> > memory.

> > I have a Visual Basic Application that does this.

> > VBNovice



> > > If you want the code to stop after issuing the OpenForm call, and
> continue
> > > only after the form is closed, you have to open the form in dialog
mode.
> > > See the help file on the OpenForm method for details, but I think the
> > syntax
> > > would be something like

> > >     DoCmd.OpenForm "frmMyForm",WindowMode:=acDialog

> > > --

> > > Dirk Goldgar
> > > (to reply via email, remove NOSPAM from address)


> > > >In my VBA, I do some stuff to populate a temp table.

> > > >I then open up a form using that temp table for editing.

> > > >Then, the code is supposed to contine, using the newly
> > > >updated/changed/added/ date in the temp table to repopulate another
> > table.

> > > >Problem is, the code keeps running right past the docmd.openform
line!

> > > >So the changes made via the form are all ignored.

> > > >How to fix?
> > > >--
> > > >Bill

> > > >PhotoSourceFolio webmaster
> > > >http://www.photosourcefolio.com



Tue, 26 Aug 2003 03:45:37 GMT  
 halt processing
Well, I did have a docmd.close line, but after I removed it, the form stayed
on the screen.

However, if the form was in form view, then processing halted, but not if
the form was opened in datasheet mode--processing continued then.

So I guess it's back to high CPU utilization.

:-(

--
Bill

PhotoSourceFolio webmaster
http://www.photosourcefolio.com


Quote:
> I'm not sure, but the problem may be with your use of acFormDS.  I'm using
> Access 97, not A2K, but when I use acFormDS and WindowMode:=acDialog
> together, the form opens modal, but in normal, single-form view, not in
> datasheet view.  That suggests to me that it may not be possible to open a
> form both modal and in datasheet view, and that A2K may be failing where
A97
> just substituted a different view.  Either that, or there's some code on
> your form forcing an immediate closing.

> Try opening the form with acDialog, but in normal view instead of
datasheet.
> Does it open properly then?

> --

> Dirk Goldgar
> (remove NOSPAM from reply address)



> > Boy, did that ever fail!

> > the form only popped on the screen ever so briefly and then disappeared!

> > I used this:

> >     DoCmd.OpenForm "tbl_Special", acFormDS, , , , acDialog

> > --
> > Bill

> > PhotoSourceFolio webmaster
> > http://www.photosourcefolio.com



> > > Group,

> > > Shouldn't he be able to open the form  as a MODAL form?  That should
> stop
> > > all processing until he closes the form and it won't utilize all of
the
> > > memory.

> > > I have a Visual Basic Application that does this.

> > > VBNovice



> > > > If you want the code to stop after issuing the OpenForm call, and
> > continue
> > > > only after the form is closed, you have to open the form in dialog
> mode.
> > > > See the help file on the OpenForm method for details, but I think
the
> > > syntax
> > > > would be something like

> > > >     DoCmd.OpenForm "frmMyForm",WindowMode:=acDialog

> > > > --

> > > > Dirk Goldgar
> > > > (to reply via email, remove NOSPAM from address)


> > > > >In my VBA, I do some stuff to populate a temp table.

> > > > >I then open up a form using that temp table for editing.

> > > > >Then, the code is supposed to contine, using the newly
> > > > >updated/changed/added/ date in the temp table to repopulate another
> > > table.

> > > > >Problem is, the code keeps running right past the docmd.openform
> line!

> > > > >So the changes made via the form are all ignored.

> > > > >How to fix?
> > > > >--
> > > > >Bill

> > > > >PhotoSourceFolio webmaster
> > > > >http://www.photosourcefolio.com



Tue, 26 Aug 2003 07:59:00 GMT  
 halt processing
I guess so, if you really need the form to appear in datasheet view.  Have
you checked to see if the same problem arises with continuous forms?  You
can make such a form look pretty much the same as a datasheet view.

If you're looping while the form is open, you're using DoEvents in the loop,
right?

--

Dirk Goldgar
(to reply via email, remove NOSPAM from address)

Quote:

>Well, I did have a docmd.close line, but after I removed it, the form
stayed
>on the screen.

>However, if the form was in form view, then processing halted, but not if
>the form was opened in datasheet mode--processing continued then.

>So I guess it's back to high CPU utilization.

>:-(

>--
>Bill

>PhotoSourceFolio webmaster
>http://www.photosourcefolio.com



>> I'm not sure, but the problem may be with your use of acFormDS.  I'm
using
>> Access 97, not A2K, but when I use acFormDS and WindowMode:=acDialog
>> together, the form opens modal, but in normal, single-form view, not in
>> datasheet view.  That suggests to me that it may not be possible to open
a
>> form both modal and in datasheet view, and that A2K may be failing where
>A97
>> just substituted a different view.  Either that, or there's some code on
>> your form forcing an immediate closing.

>> Try opening the form with acDialog, but in normal view instead of
>datasheet.
>> Does it open properly then?

>> --

>> Dirk Goldgar
>> (remove NOSPAM from reply address)



>> > Boy, did that ever fail!

>> > the form only popped on the screen ever so briefly and then
disappeared!

>> > I used this:

>> >     DoCmd.OpenForm "tbl_Special", acFormDS, , , , acDialog

>> > --
>> > Bill

>> > PhotoSourceFolio webmaster
>> > http://www.photosourcefolio.com



>> > > Group,

>> > > Shouldn't he be able to open the form  as a MODAL form?  That should
>> stop
>> > > all processing until he closes the form and it won't utilize all of
>the
>> > > memory.

>> > > I have a Visual Basic Application that does this.

>> > > VBNovice



>> > > > If you want the code to stop after issuing the OpenForm call, and
>> > continue
>> > > > only after the form is closed, you have to open the form in dialog
>> mode.
>> > > > See the help file on the OpenForm method for details, but I think
>the
>> > > syntax
>> > > > would be something like

>> > > >     DoCmd.OpenForm "frmMyForm",WindowMode:=acDialog

>> > > > --

>> > > > Dirk Goldgar
>> > > > (to reply via email, remove NOSPAM from address)


>> > > > >In my VBA, I do some stuff to populate a temp table.

>> > > > >I then open up a form using that temp table for editing.

>> > > > >Then, the code is supposed to contine, using the newly
>> > > > >updated/changed/added/ date in the temp table to repopulate
another
>> > > table.

>> > > > >Problem is, the code keeps running right past the docmd.openform
>> line!

>> > > > >So the changes made via the form are all ignored.

>> > > > >How to fix?
>> > > > >--
>> > > > >Bill

>> > > > >PhotoSourceFolio webmaster
>> > > > >http://www.photosourcefolio.com



Tue, 26 Aug 2003 08:12:49 GMT  
 halt processing
Yep, DoEvents.

Didn't try continuous forms. Might be an option.

--
Bill

PhotoSourceFolio webmaster
http://www.photosourcefolio.com


Quote:
> I guess so, if you really need the form to appear in datasheet view.  Have
> you checked to see if the same problem arises with continuous forms?  You
> can make such a form look pretty much the same as a datasheet view.

> If you're looping while the form is open, you're using DoEvents in the
loop,
> right?

> --

> Dirk Goldgar
> (to reply via email, remove NOSPAM from address)


> >Well, I did have a docmd.close line, but after I removed it, the form
> stayed
> >on the screen.

> >However, if the form was in form view, then processing halted, but not if
> >the form was opened in datasheet mode--processing continued then.

> >So I guess it's back to high CPU utilization.

> >:-(

> >--
> >Bill

> >PhotoSourceFolio webmaster
> >http://www.photosourcefolio.com



> >> I'm not sure, but the problem may be with your use of acFormDS.  I'm
> using
> >> Access 97, not A2K, but when I use acFormDS and WindowMode:=acDialog
> >> together, the form opens modal, but in normal, single-form view, not in
> >> datasheet view.  That suggests to me that it may not be possible to
open
> a
> >> form both modal and in datasheet view, and that A2K may be failing
where
> >A97
> >> just substituted a different view.  Either that, or there's some code
on
> >> your form forcing an immediate closing.

> >> Try opening the form with acDialog, but in normal view instead of
> >datasheet.
> >> Does it open properly then?

> >> --

> >> Dirk Goldgar
> >> (remove NOSPAM from reply address)



> >> > Boy, did that ever fail!

> >> > the form only popped on the screen ever so briefly and then
> disappeared!

> >> > I used this:

> >> >     DoCmd.OpenForm "tbl_Special", acFormDS, , , , acDialog

> >> > --
> >> > Bill

> >> > PhotoSourceFolio webmaster
> >> > http://www.photosourcefolio.com



> >> > > Group,

> >> > > Shouldn't he be able to open the form  as a MODAL form?  That
should
> >> stop
> >> > > all processing until he closes the form and it won't utilize all of
> >the
> >> > > memory.

> >> > > I have a Visual Basic Application that does this.

> >> > > VBNovice



> >> > > > If you want the code to stop after issuing the OpenForm call, and
> >> > continue
> >> > > > only after the form is closed, you have to open the form in
dialog
> >> mode.
> >> > > > See the help file on the OpenForm method for details, but I think
> >the
> >> > > syntax
> >> > > > would be something like

> >> > > >     DoCmd.OpenForm "frmMyForm",WindowMode:=acDialog

> >> > > > --

> >> > > > Dirk Goldgar
> >> > > > (to reply via email, remove NOSPAM from address)


> >> > > > >In my VBA, I do some stuff to populate a temp table.

> >> > > > >I then open up a form using that temp table for editing.

> >> > > > >Then, the code is supposed to contine, using the newly
> >> > > > >updated/changed/added/ date in the temp table to repopulate
> another
> >> > > table.

> >> > > > >Problem is, the code keeps running right past the docmd.openform
> >> line!

> >> > > > >So the changes made via the form are all ignored.

> >> > > > >How to fix?
> >> > > > >--
> >> > > > >Bill

> >> > > > >PhotoSourceFolio webmaster
> >> > > > >http://www.photosourcefolio.com



Tue, 26 Aug 2003 10:49:21 GMT  
 halt processing

Quote:
> Also, as I kinda suspected, this method causes the computer to shoot to 100%

Yes, but it is spending (almost) 100% of it's time waiting for anybody else to do
anything -- the 100% number is because you are running a wait loop instead of
just using the system wait loop
Quote:

> Also, as I kinda suspected, this method causes the computer to shoot to 100%
> utilization while in the loop.

> --
> Bill

> PhotoSourceFolio webmaster
> http://www.photosourcefolio.com



> > If you add the following function to your module:
> > Function IsLoaded(ByVal strFormName As String) As Integer
> >  ' Returns True if the specified form is open in Form view or Datasheet
> > view.

> >     Const conObjStateClosed = 0
> >     Const conDesignView = 0

> >     If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <>
> > conObjStateClosed Then
> >         If Forms(strFormName).CurrentView <> conDesignView Then
> >             IsLoaded = True
> >         End If
> >     End If
> > Then, after you open the form you can put the following code to have the
> > routine that opened the form sit and wait
> >     Do While IsLoaded("FormName")
> >         DoEvents
> >     Loop
> > Your routine will stay in the Do While loop until the form is closed
> > (DoEvents yields execution so that the operating system can process other
> > events).

> > Hope this helps,
> > Dom Cassone



> > > In my VBA, I do some stuff to populate a temp table.

> > > I then open up a form using that temp table for editing.

> > > Then, the code is supposed to contine, using the newly
> > > updated/changed/added/ date in the temp table to repopulate another
> table.

> > > Problem is, the code keeps running right past the docmd.openform line!

> > > So the changes made via the form are all ignored.

> > > How to fix?
> > > --
> > > Bill

> > > PhotoSourceFolio webmaster
> > > http://www.photosourcefolio.com



Tue, 26 Aug 2003 13:46:02 GMT  
 
 [ 14 post ] 

 Relevant Pages 

1. Is there any way to halt sending while processing messages

2. Halting and application in process

3. Access program halts without breakpoint

4. Halting execution of Access97

5. halt macro from code

6. Creating or Opening Document Halts Macro

7. TIP: Allowing a user to halt a macro

8. help with halting Sub Main()

9. halt windows operation

10. Halt in Loop

11. System Halt

12. Halting a click event

 

 
Powered by phpBB® Forum Software