From: OD on
Really not much to show.
Private Sub cmdEditEmp_Click()
On Error GoTo HandleError


DoCmd.OpenForm "frmEditEmployeeLicInfo"


After some of the conversations here, I had a Me.Requery or Me.Refresh after
the above line. When I tried tracing through the program it would make the
call but it wouldn't "leave" the form. It went on to the next line
(refresh,requery) and stopped on the line after docmd.OpenForm instead of
passing control over to the next form which is why it seems like the refresh,
requery, repaint that has been suggested isn't working as it actually never
gives up control

"BruceM via AccessMonster.com" wrote:

> It would help to see the code you are using. Please describe where the break
> point is placed, and what happens (or doesn't) as you step through the code.
>
> OD wrote:
> >Thanks Doug,
> >
> >Yeah, it's confusing and I think I brought it on myself. Just can't figure
> >out how to dig myself out. I put a breakpoint in after the call to open the
> >next form and the program went to the next line in the current form and
> >didn't open the next form. The next form is an unbound which I do an update
> >query to modify the record but since I'm technically not closing or leaving
> >the prior form there's no "activate", "Focus" or anything like that. I'm
> >playing with closing the forms as I call the next one and then reopening but
> >this is giving me issues doing that too.
> >Like I said, probably brounght on by how I imagined doing this.
> >
> >Thanks
> >
> >> Not sure I understand what you're saying.
> >>
> >[quoted text clipped - 39 lines]
> >>
> >> .
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201005/1
>
> .
>
From: BruceM via AccessMonster.com on
I will use frmMain as the name of the form in which the command button code
exists. I don't think I have tried requerying the current form after the
line of code that opens another form, but I suspect part of the problem at
least is that the "attention" goes back to frmMain when you requery or
refresh it. Is the code you posted all of the code? If so, what did you
mean in the previous posting by "the program went to the next line in the
current form and didn't open the next form"? If not, what other code is in
the cmdEditEmp Click event? Did frmEditEmployeeLicInfo open, but end up
behind frmMain?

If you want a form to stay on top until it is closed or hidden, open it in
dialog mode:

DoCmd.OpenForm "frmEditEmployeeLicInfo",WindowMode:=acDialog

Also, if frmMain is opened in dialog mode I think you will need to hide or
close it before opening another form.


OD wrote:
>Really not much to show.
>Private Sub cmdEditEmp_Click()
> On Error GoTo HandleError
>
>
> DoCmd.OpenForm "frmEditEmployeeLicInfo"
>
>
>After some of the conversations here, I had a Me.Requery or Me.Refresh after
>the above line. When I tried tracing through the program it would make the
>call but it wouldn't "leave" the form. It went on to the next line
>(refresh,requery) and stopped on the line after docmd.OpenForm instead of
>passing control over to the next form which is why it seems like the refresh,
>requery, repaint that has been suggested isn't working as it actually never
>gives up control
>
>> It would help to see the code you are using. Please describe where the break
>> point is placed, and what happens (or doesn't) as you step through the code.
>[quoted text clipped - 18 lines]
>> >>
>> >> .

--
Message posted via http://www.accessmonster.com

From: OD on
Excellent. Thank you all for the tips. I put the code in the on activate
event and it works for the most part. i just have one more refresh to take
care

Thanks again

"BruceM via AccessMonster.com" wrote:

> I will use frmMain as the name of the form in which the command button code
> exists. I don't think I have tried requerying the current form after the
> line of code that opens another form, but I suspect part of the problem at
> least is that the "attention" goes back to frmMain when you requery or
> refresh it. Is the code you posted all of the code? If so, what did you
> mean in the previous posting by "the program went to the next line in the
> current form and didn't open the next form"? If not, what other code is in
> the cmdEditEmp Click event? Did frmEditEmployeeLicInfo open, but end up
> behind frmMain?
>
> If you want a form to stay on top until it is closed or hidden, open it in
> dialog mode:
>
> DoCmd.OpenForm "frmEditEmployeeLicInfo",WindowMode:=acDialog
>
> Also, if frmMain is opened in dialog mode I think you will need to hide or
> close it before opening another form.
>
>
> OD wrote:
> >Really not much to show.
> >Private Sub cmdEditEmp_Click()
> > On Error GoTo HandleError
> >
> >
> > DoCmd.OpenForm "frmEditEmployeeLicInfo"
> >
> >
> >After some of the conversations here, I had a Me.Requery or Me.Refresh after
> >the above line. When I tried tracing through the program it would make the
> >call but it wouldn't "leave" the form. It went on to the next line
> >(refresh,requery) and stopped on the line after docmd.OpenForm instead of
> >passing control over to the next form which is why it seems like the refresh,
> >requery, repaint that has been suggested isn't working as it actually never
> >gives up control
> >
> >> It would help to see the code you are using. Please describe where the break
> >> point is placed, and what happens (or doesn't) as you step through the code.
> >[quoted text clipped - 18 lines]
> >> >>
> >> >> .
>
> --
> Message posted via http://www.accessmonster.com
>
> .
>