Problems when closing a form in an Exit-Event 
Author Message
 Problems when closing a form in an Exit-Event

Hi,
i have a form with a text field.

When the user enters data in it, i use the Exit-Event to check the data and
want to
open another form AND close the current, something like that:

Private Sub textIDBerater_Exit(Cancel As Integer)
    DoCmd.OpenForm frmEmpfang_Men
    DoCmd.Close acForm, frmEmpfang_MieterNeuerTermin
End Sub

BUT, the DoCmd.Close gets an error: Not allowed while in an event?

So, how to step from one form to another when leaving a text field?

Thanks
Ralph

Ralph G?stenmeier ICQ#:105344449



Sun, 10 Oct 2004 19:46:25 GMT  
 Problems when closing a form in an Exit-Event
There may be more elegant solutions but one way is to use the Form_Open
Event of the second form to close the first Form with a DoCmd.Close.

--
HTH
Van T. Dinh
MVP (Access)


Quote:
> Hi,
> i have a form with a text field.

> When the user enters data in it, i use the Exit-Event to check the data
and
> want to
> open another form AND close the current, something like that:

> Private Sub textIDBerater_Exit(Cancel As Integer)
>     DoCmd.OpenForm frmEmpfang_Men
>     DoCmd.Close acForm, frmEmpfang_MieterNeuerTermin
> End Sub

> BUT, the DoCmd.Close gets an error: Not allowed while in an event?

> So, how to step from one form to another when leaving a text field?

> Thanks
> Ralph

> Ralph G?stenmeier ICQ#:105344449



Sun, 10 Oct 2004 21:19:16 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problem with Controlled Closing of a Form when exiting throught the Window-Close-Button

2. ignore Exit event at form close?

3. Run exit event from other exit event

4. Control Exit event kills Button Click Event in Access2002 Forms

5. Opening form 2 from form 1 - what form/event to close form 1

6. Excel (File/Exit) not closing with Workbook_BeforeClose event

7. Capture Events (not close/open/exit)

8. Close Event (To Close a Form)

9. beforeupdate event on form, problems with close

10. exit record after "on exit" event


 
Powered by phpBB® Forum Software © phpBB Group