If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Run-time Error 2585: Unable to Close Form
Hi, I need some help here, no matter what I do I can not close the FS form.
On my FS For I have on single text box (tlogin) and I am using the Enter event to to some "systems checks" then launch the Main Form (FMAIN) Private Sub tlogin_Enter() On Error GoTo Err_Command_tlogin_Enter If IsNull(Me.tlogin) = True Then Exit Sub End If var_user = Me.tlogin 'CHECK IF EMP IS ON TC If emp_is_tc(var_user) = False Then 'EMP IS NOT ON TC 'CHECK IF EMP IS ON DBA If emp_is_dba(var_user) = False Then 'EMP IS NOT ON DBA, EXIT SUB Responce = MsgBox("Unable to Find Emp ID. Contact Foreman. ", vbCritical, " UMCORP") Exit Sub End If 'INSERT EMP INTO TIME CLOCK emp_new (var_user) End If 'CHECK IF EMP IS IN (SHIFT_START) If shift_in(var_user) = False Then shift_start (var_user) End If 'ALL SYSTEMS CHECKED!!! OPEN MAIN WINDOW Me.tlogin = Null DoCmd.OpenForm "FMAIN" DoCmd.Close acForm, "FS" Exit_Command_tlogin_Enter: Exit Sub Err_Command_tlogin_Enter: MsgBox Err.Description & " " & Err.Number Resume Exit_Command_tlogin_Enter End Sub |
#2
|
|||
|
|||
Run-time Error 2585: Unable to Close Form
"Bre-x" wrote in message
... Hi, I need some help here, no matter what I do I can not close the FS form. On my FS For I have on single text box (tlogin) and I am using the Enter event to to some "systems checks" then launch the Main Form (FMAIN) Private Sub tlogin_Enter() On Error GoTo Err_Command_tlogin_Enter If IsNull(Me.tlogin) = True Then Exit Sub End If var_user = Me.tlogin 'CHECK IF EMP IS ON TC If emp_is_tc(var_user) = False Then 'EMP IS NOT ON TC 'CHECK IF EMP IS ON DBA If emp_is_dba(var_user) = False Then 'EMP IS NOT ON DBA, EXIT SUB Responce = MsgBox("Unable to Find Emp ID. Contact Foreman. ", vbCritical, " UMCORP") Exit Sub End If 'INSERT EMP INTO TIME CLOCK emp_new (var_user) End If 'CHECK IF EMP IS IN (SHIFT_START) If shift_in(var_user) = False Then shift_start (var_user) End If 'ALL SYSTEMS CHECKED!!! OPEN MAIN WINDOW Me.tlogin = Null DoCmd.OpenForm "FMAIN" DoCmd.Close acForm, "FS" Exit_Command_tlogin_Enter: Exit Sub Err_Command_tlogin_Enter: MsgBox Err.Description & " " & Err.Number Resume Exit_Command_tlogin_Enter End Sub When are you thinking that the Enter event fires? It's not when the user presses the Enter key, if that's what you were thinking. I suspect that you ought to be using the text box's AfterUpdate event, but maybe there's some logic behind this that I'm not understanding. -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
#3
|
|||
|
|||
Run-time Error 2585: Unable to Close Form
Thank you!!!
I change my code to the AfterUpdate event and everything is working fine!!!! "Dirk Goldgar" wrote in message ... "Bre-x" wrote in message ... Hi, I need some help here, no matter what I do I can not close the FS form. On my FS For I have on single text box (tlogin) and I am using the Enter event to to some "systems checks" then launch the Main Form (FMAIN) Private Sub tlogin_Enter() On Error GoTo Err_Command_tlogin_Enter If IsNull(Me.tlogin) = True Then Exit Sub End If var_user = Me.tlogin 'CHECK IF EMP IS ON TC If emp_is_tc(var_user) = False Then 'EMP IS NOT ON TC 'CHECK IF EMP IS ON DBA If emp_is_dba(var_user) = False Then 'EMP IS NOT ON DBA, EXIT SUB Responce = MsgBox("Unable to Find Emp ID. Contact Foreman. ", vbCritical, " UMCORP") Exit Sub End If 'INSERT EMP INTO TIME CLOCK emp_new (var_user) End If 'CHECK IF EMP IS IN (SHIFT_START) If shift_in(var_user) = False Then shift_start (var_user) End If 'ALL SYSTEMS CHECKED!!! OPEN MAIN WINDOW Me.tlogin = Null DoCmd.OpenForm "FMAIN" DoCmd.Close acForm, "FS" Exit_Command_tlogin_Enter: Exit Sub Err_Command_tlogin_Enter: MsgBox Err.Description & " " & Err.Number Resume Exit_Command_tlogin_Enter End Sub When are you thinking that the Enter event fires? It's not when the user presses the Enter key, if that's what you were thinking. I suspect that you ought to be using the text box's AfterUpdate event, but maybe there's some logic behind this that I'm not understanding. -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
Thread Tools | |
Display Modes | |
|
|