Instant messaging within Access? (1 Viewer)

stevekos07

Registered User.
Local time
Yesterday, 17:16
Joined
Jul 26, 2015
Messages
174
Hi all. I have a database that runs on an intranet across the state, and there are times when it would be really handy to send messages to specific users. How would I go about setting this up. I imaging that a form with some VBA code referencing a specific username would be required.



Is there anything on this forum or any other tutorial anywhere that anyone can recommend on this?
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 17:16
Joined
Aug 30, 2003
Messages
36,123
Haven't done it but it shouldn't be hard. You'd need a table for messages, including a recipient field and a "read" field. You'd use the timer event of a form that is always open to check that table for messages for the logged in user where the "read" field hasn't been set (probably a Yes/No field). If found, pull up for the user and set the "read" field appropriately. Obviously you'd also have a form to create messages that saves to that table.
 

stevekos07

Registered User.
Local time
Yesterday, 17:16
Joined
Jul 26, 2015
Messages
174
Yes, that sounds like it would work. I actually used an OnLoad event to play a practical joke on a colleague one time that used an If statement to reference his username and launch a form. I could use the OnTimer event to launch a message form in a similar fashion. Thanks.
 

Dreamweaver

Well-known member
Local time
Today, 01:16
Joined
Nov 28, 2005
Messages
2,466
A messaging system is simple you will need a form to add the message, 1 to view message when user logs on use a main control or hidden form code as below:
I have an timer interval of 1000 For the Clock
This code is used for both a reminders and messaging system

hope it helps

Code:
On Error GoTo HandleErr
Me!lblClock.Caption = Format(Now, "dddd, mmm d yyyy, hh:mm:ss AMPM")
Dim IntAdds As String
Dim m_Db As Database
Dim RMD As DAO.Recordset
Set m_Db = CurrentDb()

NumTime = NumTime + 1
    Select Case NumTime
    'Has this user logged out
        Case 10
            If IsOpen("frmDetectIdleTime") Then
                Set RMD = m_Db.OpenRecordset("SELECT * FROM QryReminderWatcherSupport WHERE [EmployeeTo]=" & Forms!frmDetectIdleTime!txtUser, dbOpenDynaset)
                If RMD.RecordCount <> 0 Then
                    Do While Not RMD.EOF
                        If RMD("Type") = 2 Then
                            Call ShowCommunicator(RMD("RemindID"))
                            RMD.Edit
                            RMD("Done") = 1
                            RMD.Update
                        End If
                        If RMD("Type") = 1 Then
                            Call ShowReminder(RMD("RemindID"))
                            RMD.Edit
                            RMD("Done") = 1
                            RMD.Update
                        End If
                    RMD.MoveNext
                    Loop
                End If
        NumTime = -1
            End If
    End Select
            
HandleExit:
    Exit Sub
    
HandleErr:
    Select Case Err.Number
        Case Else
            Call GlobalErr("Form Schedule Watcher", "Form Timer", Err.Number, Err.Description, Err.Source)
            Resume HandleExit
        Resume
    End Select
 

NauticalGent

Ignore List Poster Boy
Local time
Yesterday, 20:16
Joined
Apr 27, 2015
Messages
6,319
Haven't done it but it shouldn't be hard. You'd need a table for messages, including a recipient field and a "read" field. You'd use the timer event of a form that is always open to check that table for messages for the logged in user where the "read" field hasn't been set (probably a Yes/No field). If found, pull up for the user and set the "read" field appropriately. Obviously you'd also have a form to create messages that saves to that table.

I have employed this method and it works like something that works really well. I believe I got the idea from one of Colin's (Isladogs) sample DB's but I cant recall at his moment.
 

stevekos07

Registered User.
Local time
Yesterday, 17:16
Joined
Jul 26, 2015
Messages
174
I have done it! I used the OnTimer method to call a form which pops up based on whether there are any unread (checkbox True/False) messages specific to the user (TempVars set on login). Everything else is pretty simple with a messages table, users table and straightforward development features. It isn't sophisticated but it works as a pretty good two-way messaging system. I have used macros where possible with some VBA where necessary so that relative newbies can get it to work.



I am happy to make it available if anybody is interested. Here is the OneDrive link: https://1drv.ms/u/s!AkgxrobOK5LakRB2IlZy0P3FriPF
 
Last edited:

NauticalGent

Ignore List Poster Boy
Local time
Yesterday, 20:16
Joined
Apr 27, 2015
Messages
6,319
Congrats and thank you for the update, glad it worked out for you.
 

Dreamweaver

Well-known member
Local time
Today, 01:16
Joined
Nov 28, 2005
Messages
2,466
stevekos07 you should note that you may get more than one message poping up for a loged in user if there is a large employee base in that case you should look for multi instances of a form this will allow each message to be displayed without overwriting the details of the original message.
 
Last edited:

stevekos07

Registered User.
Local time
Yesterday, 17:16
Joined
Jul 26, 2015
Messages
174
Yes, that is true if there is a large user base with many users messaging each other. In the situation where I will be using this solution I do not anticipate that. For one thing most of the users are volunteers who have lower level access to the system. For them I would simply make the "Open Popup Messages" button unavailable, so they will not be able to send messages directly, only receive them. And I will be stressing that the use of this system is mainly for communicating from management or system administrators to users to convey specific instructions to individual users, in which situation there is unlikely to be more than one message per session to any user, if that.


To put my situation into perspective, I manage the database that is used to run a social program for the Red Cross. It is an emergency service that is run under specific conditions from time to time as a call centre operation. The problem I have is that many users log into generic logins in Citrix that are not user-specific, but log into Access under specific usernames and passwords. So I can't use system-based messaging solutions to address many of these users. So this is a way of at least sending a message without having to physically find them or phone the location where they are working.



Of course there are more sophisticated solutions available for larger user groups or for users with more autonomy. This is only a solution suitable to my situation, and is presented as a possible solution to others with similar needs.



In our situation most staff communication is handled either through Skype for Business or email. So this is a specific in-application solution for my specific needs.
 

Dreamweaver

Well-known member
Local time
Today, 01:16
Joined
Nov 28, 2005
Messages
2,466
I've just posted a project on my site that might give you a few idears the link is in my sig
it is a accde but if your interested in how bits work I wont mind helping the red cross.
 

Users who are viewing this thread

Top Bottom