W
WasAGuru
I know about KB articles Q164455 and Q190074 - I am using
an If..Then statement that checks the return value of a
function. There are no subforms. All DAO datasets are
guaranteed closed and all variables used are double-
checked to SET to nothing. I changed the If..Then
statement to EXPLICITLY test for true (The failure occurs
if the conditional test happens to be FALSE - if it's TRUE
then after stuff happens and I click the close button, the
database closes nicely). But I still get this darned
error - Access will close the database windows but the
application minimizes into the task bar without closing.
No error messages. No way to close Access without using
Task Manager. Anyone know how to FORCE Access to close -
ALL THE WAY?
Here's the section of code where the problem lies (I see
nothing wrong with any logic here):
Private Sub Form_Load()
Dim rst As Recordset, boolEmp As Boolean
Dim dbs As Database, strSQL As String
On Error Resume Next
Calendar.Value = DateSerial(Year(Now()), Month(Now()),
Day(Now()))
dtmDate.DefaultValue = Empty
' Return reference to current database.
Set dbs = CurrentDb
strSQL = "SELECT * FROM qryEmployees WHERE [strUserID]
= '" & CurrentUser & "';"
Set rst = dbs.OpenRecordset(strSQL)
boolEmp = CurrentUserInGroup("Manager")
If boolEmp = True Then
tbxEmployee.Visible = False
cbxEmployee.Visible = True
Else
cbxEmployee.Visible = False
tbxEmployee = rst.Fields(0)
tbxName = rst.Fields(1)
tbxDepartment = rst.Fields(2)
tbxEmployee.Visible = True
End If
rst.Close
Set rst = Nothing
Set dbs = Nothing
Debug.Print "Form 'frmTimeTracker' Opened Successfully"
End Sub
--PullingMyHairOut(WhatsLeftUpThere)
an If..Then statement that checks the return value of a
function. There are no subforms. All DAO datasets are
guaranteed closed and all variables used are double-
checked to SET to nothing. I changed the If..Then
statement to EXPLICITLY test for true (The failure occurs
if the conditional test happens to be FALSE - if it's TRUE
then after stuff happens and I click the close button, the
database closes nicely). But I still get this darned
error - Access will close the database windows but the
application minimizes into the task bar without closing.
No error messages. No way to close Access without using
Task Manager. Anyone know how to FORCE Access to close -
ALL THE WAY?
Here's the section of code where the problem lies (I see
nothing wrong with any logic here):
Private Sub Form_Load()
Dim rst As Recordset, boolEmp As Boolean
Dim dbs As Database, strSQL As String
On Error Resume Next
Calendar.Value = DateSerial(Year(Now()), Month(Now()),
Day(Now()))
dtmDate.DefaultValue = Empty
' Return reference to current database.
Set dbs = CurrentDb
strSQL = "SELECT * FROM qryEmployees WHERE [strUserID]
= '" & CurrentUser & "';"
Set rst = dbs.OpenRecordset(strSQL)
boolEmp = CurrentUserInGroup("Manager")
If boolEmp = True Then
tbxEmployee.Visible = False
cbxEmployee.Visible = True
Else
cbxEmployee.Visible = False
tbxEmployee = rst.Fields(0)
tbxName = rst.Fields(1)
tbxDepartment = rst.Fields(2)
tbxEmployee.Visible = True
End If
rst.Close
Set rst = Nothing
Set dbs = Nothing
Debug.Print "Form 'frmTimeTracker' Opened Successfully"
End Sub
--PullingMyHairOut(WhatsLeftUpThere)