Hi
Firstly Im a complete beginner
I have a table called "tblWorker" which contains my login information:
The login all works fine (I downloaded it), I want to add a timed pop up reminder for tasks that appear in my query "qryTaskDue"
I gratefully downloaded the example and changed the field names to suit mine but when the pop up appears it says:
Invalid use of null.
User = DLookup("WorkerName", "tblWorker", "LoginID = '" & Login & "'")
Im a complete beginner so was hoping someone could look at this code for me please:
Firstly Im a complete beginner
I have a table called "tblWorker" which contains my login information:
Code:
WorkerID | WorkerName | LoginID | Password | UserType
------------+------------------+---------------+----------------+-----------
12 | Jonathan | jon | ***** | Admin
16 | donna | donna | *** | User
I gratefully downloaded the example and changed the field names to suit mine but when the pop up appears it says:
Invalid use of null.
User = DLookup("WorkerName", "tblWorker", "LoginID = '" & Login & "'")
Im a complete beginner so was hoping someone could look at this code for me please:
Code:
Private Sub Form_Timer()
Static count As Integer
count = count + 1
If count = 30 Then
Me.TimerInterval = 0
Call YouHaveTaskDue
Exit Sub
End If
End Sub
[COLOR=Green]'.......................................................................................[/COLOR]
Sub YouHaveTaskDue()
Dim Login As String
Dim User As Integer
Login = Environ("WorkerName")
User = DLookup("WorkerName", "tblWorker", "LoginID = '" & Login & "'")
If IsNull(DLookup("taskid", "qryTaskDue", "WorkerName = " & User)) Then
[COLOR=Green]'do nothing[/COLOR]
Else
MsgBox "You have a task due", vbInformation, "TaskDue Alert!"
End If
End Sub
Last edited by a moderator: