Hi All,
I am trying to create an instant messenger tool within the database,
mainly so messages can be left for colleagues on different shifts (not all
of them have a mail account). I have created a table with the following
fields:
from (text) default value = username obtained from module which gets unique
network username
to (text)
sent (date/time) default value = now()
message (memo)
received (yes/no)
I have created an event procedure on timer (main form) so that if a record
exists in the messages table where [from] = current user and [received] =
false a form will open displaying the message.
I am new to this and I have not got the procedure right. If a message exists
where I am not the desired recipient, the form still opens.
Could anyone tell me where I am going wrong?
Private Sub Form_Timer()
If (DLookup("[to]", "messages", "[to]") = (Me!current_user.Value) & _
DLookup("[received]", "messages", "[received]") = False) Then
DoCmd.OpenForm "message_popup"
End If
End Sub
TIA,
Mark