Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / June 2006

Tip: Looking for answers? Try searching our database.

Can't get frmLogOn to close - Please Help...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gina Whipp - 27 Jun 2006 18:23 GMT
Hi All,

Below is my code, everything works okay but frmLogOn remains open.  I do not
want to make it Visible = Flase because closing it later on causes other
issues.  I want it to close when the frmMainMenu opens.  The event below is
from the frmMainMenu.

Private Sub Form_Load()
'On Load of the switchboard check for probationary periods
Dim intProbation As Integer
Dim intTemp As Integer
Dim intHire As Integer
Dim intYearOne As Integer

intTemp = Nz(DCount("First90Days", "qryNewEmployee", "First90Days
>=Date()"), 0)
intHire = Nz(DCount("Second90Days", "qryNewEmployee", "Second90Days
>=Date()"), 0)
intYearOne = Nz(DCount("FirstYear", "qryNewEmployee", "FirstYear >=Date()"),
0)

intProbation = intTemp + intHire + intYearOne

   If intProbation = 0 Then
           Exit Sub
               Else
                   If MsgBox(intProbation & " Employee(s) ready to be hired
in " & _
                   vbCrLf & "and/or have been here for 1 year.  " & _
                   vbCrLf & "Do you want to view them now?", _
                   vbYesNo, "Probation") = vbYes Then
                   DoCmd.Minimize
                   DoCmd.OpenForm "frmNewEmployee", acNormal
                   Forms("frmLogOn").SetFocus   'nothing happens
                   DoCmd.Close acForm, "frmLogOn"   'nothing happens
               Else
           Exit Sub
       End If
   End If
End Sub

Thanks for any and all help...
Gina Whipp
jahoobob - 27 Jun 2006 19:40 GMT
You shouldn't need the line before you close frmLogOn

>Hi All,
>
[quoted text clipped - 39 lines]
>Thanks for any and all help...
>Gina Whipp
jahoobob - 27 Jun 2006 19:43 GMT
Added:  I believe that when you SetFocus to the frmLogOn you lose the focus
of you Sub and thus it stops, never reaching the Close.

>You shouldn't need the line before you close frmLogOn
>
[quoted text clipped - 3 lines]
>>Thanks for any and all help...
>>Gina Whipp
Gina Whipp - 27 Jun 2006 19:51 GMT
Doesn't matter whether that line is is there or not, the form does not
close.

> You shouldn't need the line before you close frmLogOn
>
[quoted text clipped - 45 lines]
>>Thanks for any and all help...
>>Gina Whipp
jahoobob - 27 Jun 2006 20:16 GMT
This code is running in frmLogOn, right.  If it is then try deleting the
DoCmd.Minimize and just use DoCmd.Close  No need to name the form from code
in the form.

>Doesn't matter whether that line is is there or not, the form does not
>close.
[quoted text clipped - 4 lines]
>>>Thanks for any and all help...
>>>Gina Whipp
Gina Whipp - 27 Jun 2006 20:51 GMT
No this code is running on frmMainMenu.

> This code is running in frmLogOn, right.  If it is then try deleting the
> DoCmd.Minimize and just use DoCmd.Close  No need to name the form from
[quoted text clipped - 9 lines]
>>>>Thanks for any and all help...
>>>>Gina Whipp
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.