Hi,
I am trying to use the code found in faq181-2145. I have made the DB called TimeCtl. I am trying to log off users in a DB called Litigation Database.
I have established a reference to TimeCtl from Litigation Database. I have also linked the table tblLogOut to the TimeCtl DB.
When I open the Litigation Database I get this;
Compile Error: User-defined type not defined
Here is the code for the module and highlighted area;
Can anyone point me in the right direction on this?
Thanks in advance.
I am trying to use the code found in faq181-2145. I have made the DB called TimeCtl. I am trying to log off users in a DB called Litigation Database.
I have established a reference to TimeCtl from Litigation Database. I have also linked the table tblLogOut to the TimeCtl DB.
When I open the Litigation Database I get this;
Compile Error: User-defined type not defined
Here is the code for the module and highlighted area;
Code:
[highlight]Public Function funShutDown(DatabaseName As String) As Boolean: funShutDown = False[/highlight]
Dim db As Database
Dim rs As Recordset
Dim strSQL As String
DatabaseName = UCase(DatabaseName)
Dim myDate As Date: myDate = Now()
strSQL = "SELECT * FROM TBLLOGOUT WHERE APPLICATIONNAME = '" & DatabaseName & "' AND INACTIVE = 0 AND #" & myDate & "# BETWEEN LOGOFFSTART AND LOGOFFEND"
Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)
If rs.RecordCount = 0 Then
GoTo OutShutDown
Else
funShutDown = True
End If
OutShutDown:
rs.Close
Set rs = Nothing
Set db = Nothing
Exit Function
End Function
Can anyone point me in the right direction on this?
Thanks in advance.