G
Gina Whipp
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
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
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
intHire = Nz(DCount("Second90Days", "qryNewEmployee", "Second90Days=Date()"), 0)
intYearOne = Nz(DCount("FirstYear", "qryNewEmployee", "FirstYear >=Date()"),=Date()"), 0)
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