473,386 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Access Instant Messenger

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
Nov 13 '05 #1
1 4874
"Mark R" <ma*********@ntlworld.com> wrote in message news:<7e**************@newsfe1-gui.ntli.net>...
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

Mark,
Your syntax is a little off on the DLookUp
The equals sign goes inside the quotes with the field name
Put the value you are comparing inside the parens
If (DLookup("[to]", "messages", "[to] = " & Me!current_user.Value)) then
Hank Reed
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: CountScubula | last post by:
Hello everyone. Ok, a lot of people here have emailed me about instant messenger, so I took some code out of a project I buit, and posted the code. You can find it here:...
2
by: Evan McPeters | last post by:
Does anyone have an example of a simple Instant Messenger program written in Python? I have some code for a simple server and simple client communicating over TCP/IP, so I could always combine...
1
by: Peter | last post by:
Hi all, I have a website where users login to and I wish to add Instant Messenger between 2 users.. for instance, clicking "IM" on someone's profile (assuming they're online of course) will...
10
by: Dee | last post by:
Is C++ the best language to create a Windows based Instant Messenger? Something along the lines of MSN Messenger, ICQ, Yahoo Chat, etc? Are there any downloadable full or trial SDK's out there?...
0
by: Colin Tiernan | last post by:
Hi, Can someone please put me right here. I've been asked to send messages to instant messenger through my asp.net 1.1 website, as a feature of a message board that I had to hand code. I...
0
by: Dean Sharp | last post by:
Hi For my university final year project i have been developing a instant messaging application based on the .net 1.1 framework. I would be very greatful if some people would give this...
6
by: lalejo83 | last post by:
How do I go about starting an instant messenger in C++. pLEASE HELP ME
2
by: John Doe | last post by:
Here's my issue: I have an instant messenger type feature for my site, its basically an ajax IM feature. I run with a mysql backend on the site, i have a div on my main page that runs a javascript...
1
by: Tarren | last post by:
Hi: Are there any good c# libraries for integrating aol instant messenger capabilities into my c# code? Thanks, Tayo
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.