I am trying to create an instant messenger tool within my database,
I have created a table with the following
fields:
from (text)
to (text)
message (memo)
test right now I am just typing in yes or no
I have created an event procedure on timer (main form) so that if a record
exists in the messages table where to = reviewernumber and [test] = "no"
a form will open displaying the message.
I am new to this and I have not gotten 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?
I have this running after the user logs into a form and on the form it keep the reviewnumber in a field called ReviewerNumber and in the message table it has the To field. Basically it opens any message and doesn't seem to compare the to = reviewernumber.
Not sure if this helps but the to and reviewernumber fields are text field but have a number in the field. Example is the to field would be 245 and the reviewernumber could be 245. If the to and reviewernumber field are the same then open the form.
I have created a table with the following
fields:
from (text)
to (text)
message (memo)
test right now I am just typing in yes or no
I have created an event procedure on timer (main form) so that if a record
exists in the messages table where to = reviewernumber and [test] = "no"
a form will open displaying the message.
I am new to this and I have not gotten 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?
Code:
Private Sub Form_Timer()
If (DLookup("[to]", "messages", "[to] = [ReviewerNumber]")) And DLookup("[test]", "messages", "[test]") = "no" Then
DoCmd.OpenForm "message_popup"
End If
End Sub
Not sure if this helps but the to and reviewernumber fields are text field but have a number in the field. Example is the to field would be 245 and the reviewernumber could be 245. If the to and reviewernumber field are the same then open the form.
Comment