MS Access Chat (1 Viewer)

Acke

Registered User.
Local time
Today, 16:54
Joined
Jul 1, 2006
Messages
158
As a follow up to the earlier thread, I am trying to build an all Access chat.

It should be a fairly simple project. To understand it fully, it would be necessary to learn more about the setup and solutions already implemented in the application. The information can be found in the already mentioned thread, in post #77.

The application will be designed for communication between two people on the local network.

The chat data will be stored in tblChat containing fields: ID, Person1Text, Person2Text, TimeStamp, conditionSeen1, conditionSeen2. The table will be stored in the beDB (please see the thread, post #77 for more reference).

The chat information will be presented in the subform or the main form frmTasks (reference thread, post #77). The chat message will be entered from the text field on the main form (frmTasks) to prevent interfering in cases when both users are entering the message and triggering simultaneous Loop-updating (reference thread, post #77) of the remote subform. The subform will have a name frmChat and will be continuous form. The frmChat will be part of 4 front end files (reference thread, post #77).

Received messages are located on the left side in the form's detail, sent messages on the right. The back color of the text fields are the same as the back color of the form (invisible). Using conditional formatting, when the form text filed is not Null, the back color of the text fields change (lighter color for a received, darker color for sent message) and the non-empty fields shows up.

I will post the final solution later in the thread, once the project is completed.

The chat is already functional but needs some fine-tuning. I would appreciate the support on the different issues along the way.

The issue I am currently facing is sizing the message box on the subform according to the message size. As one message can be anything from one row to many more rows, the text boxes must be somehow size-adaptable. If the text box is too high, form space is being lost (and it can never be high enough). If the text box is just one row high, the user is limited to type messages using only a certain number of characters per message. The best solution I could think of so far is to store message information in the table with max number of characters per row. For example, if max number of characters per row is set to 20 and the message has 50 characters, it would be stored in a table under 3 rows (3 IDs) 20char + 20char + 10char. Probably using the Len function. Later in the appearance, text fields are located Top = 0 and hight the same as hight of the detail, appearing closest to one "cloud" per message, as the text boxes will stick to each other. To be able to edit/delete a full message, regardless of the row numbers (different IDs in the table), one more field would be added in the table, storing the exclusive number for the group of rows (IDs) that belong to one message. Something like a group ID. The setback to this solution is that there is a line between text fields in the form. I cannot find a way to make the appearance of a single "cloud".

As this is not an appropriate solution, any suggestions on solving a single-cloud-per-message appearance issue are more than welcome. The project is at the beginning. Any work already made is easy to change at this stage. So, how would it be possible to make the one-cloud appearance?
 

isladogs

CID VIP
Local time
Today, 15:54
Joined
Jan 14, 2017
Messages
16,377
In case it helps, there is an Almost Instant Messenger example app available at the Utter Access forum.
I tried it some time ago and it worked well.
 

Acke

Registered User.
Local time
Today, 16:54
Joined
Jul 1, 2006
Messages
158
In case it helps, there is an Almost Instant Messenger example app available at the Utter Access forum.
I tried it some time ago and it worked well.

Thanks for pointing out. I am looking to make a simple and fast way of sharing short messages. Something like the Telegram for example. One-click message sending, one view at all the messages (received/sent). The Almost Instant Messenger looks like a nice application, but to complex to what I need.
 

isladogs

CID VIP
Local time
Today, 15:54
Joined
Jan 14, 2017
Messages
16,377
I’m surprised you thought the ‘AIM’ app too complex. Anyway, something else you may find useful. Look at the messaging part of my Attention Seeking example app which you can find here or on my website. I’m on my phone so can’t supply a link but it should be easy to find
 

Acke

Registered User.
Local time
Today, 16:54
Joined
Jul 1, 2006
Messages
158
I’m surprised you thought the ‘AIM’ app too complex. Anyway, something else you may find useful. Look at the messaging part of my Attention Seeking example app which you can find here or on my website. I’m on my phone so can’t supply a link but it should be easy to find

Rather impressive application. It is reporting a broken reference "sapi_onecore.dll" version5.5. I managed to see parts of the app, but probably cannot have the full experience. Where can I find the missing file? Did you solve the issue of the size adaptable message field? If yes, on which form can I find it?

For a better understanding of what I am after please see the snapshot of my application. It is very simple.

Capture.PNG


On the left, the user can see received messages. The user's messages are on the right . Text box where a single hit to enter will send the message. What I am looking at is to get rid of the line between the row when single messages were split to rows.
 

isladogs

CID VIP
Local time
Today, 15:54
Joined
Jan 14, 2017
Messages
16,377
Regarding the missing reference, if you have Windows10, its located at "C:\Windows\System32\Speech_OneCore\common\sapi_onecore.dll".
If you have Win7, you mag not have that file. Try replacing it with the older version of the Microsoft Speech Object Library at "C:\Windows\System32\Speech\Common\sapi.dll". I can't remember whether that will give full functionality in this app but the speech part is only used in one item anyway.

Sorry but no idea what you mean by the 'size adaptable message field' unless you are referring to the line where your messages are split between rows. I don't use that approach. You could keep all on one line and use a zoom box if there is too much text to fit the space.
Or you could limit the allowed size of sent messages so all the text fits in the box
 

Acke

Registered User.
Local time
Today, 16:54
Joined
Jul 1, 2006
Messages
158
Sorry but no idea what you mean by the 'size adaptable message field' unless you are referring to the line where your messages are split between rows. I don't use that approach. You could keep all on one line and use a zoom box if there is too much text to fit the space.
Or you could limit the allowed size of sent messages so all the text fits in the box

Thanks for clarifying the .dll.

I think you got right what "size-adoptable message field" means. In any case, the simplest way to explain would be to copy the behavior of the SMS app on the smartphone. You can receive single line SMS or there could be 15 lines in the SMS. In both cases, one message appears in one cloud regardless of the size. The best I could do so far is as per the image on post #6.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:54
Joined
Oct 29, 2018
Messages
19,135
What I am looking at is to get rid of the line between the row when single messages were split to rows.
Hi. One idea might be is to simply get rid of the lines. Then, if you want to have some separation between message clouds, maybe you can modify the message to add a beginning and an ending lines (maybe using dashes). Just a thought...
 

Acke

Registered User.
Local time
Today, 16:54
Joined
Jul 1, 2006
Messages
158
Hi. One idea might be is to simply get rid of the lines. Then, if you want to have some separation between message clouds, maybe you can modify the message to add a beginning and an ending lines (maybe using dashes). Just a thought...

The lines are the consequence of subform behavior. What you see is the subform containing two visible fields and one hidden. Visible: Text1 and Text2. Hidden is ID field. The line is not what I made. It is just there. Not sure if it is even technically possible to lose it. Please look at the design view of the subform:

Capture.PNG


@theDBguy, regarding your code from post #4, from what I understood, it is being used to generate comma-separated data into one string. Is that correct?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 15:54
Joined
Feb 19, 2013
Messages
14,685
not sure if this is of interest but as I indicated in your other thread you can use a memo field with the refresh setting set to 1. The attached is a basic model - names perhaps populated from username for example.

Create a copy of the FE on two pc's with the BE somewhere shared. Relink the BE to both FE's

When a name is created (so code could be the form open event to work of username) it creates a record in tblWhosOn which could be used to connect directly to one or more people. The record is deleted when the form is closed
This version just uses one record, but with modification, could have multiple chats going on a the same time.

No error checking, it is just a prototype
 

Attachments

  • Chat.zip
    290.4 KB · Views: 626

Acke

Registered User.
Local time
Today, 16:54
Joined
Jul 1, 2006
Messages
158
not sure if this is of interest but as I indicated in your other thread you can use a memo field with the refresh setting set to 1. The attached is...

The simplicity of the solution is impressive 👏. Thank you for the effort.

I am trying to use a subform rather than a text box to present the chat as it would allow users to edit/delete messages. Also, presenting messages in clouds makes the chat more appealing. Not sure if what I want to do is technically possible. In case not, I will be happy to use your solution.
 

Acke

Registered User.
Local time
Today, 16:54
Joined
Jul 1, 2006
Messages
158
Presenting a multi-row message in one cloud is possible using the report instead of form. Option "Can Grow" makes the text adaptable to the message size. I've replaced the form with a report. That part is solved.

Now, I need the report (which is now a subform of the main form tasks) to move to the last page. I used SendKeys"{End}", True with form timer event to force the report to the last page. It is working when the report is being opened alone. When opened as a subform (or subreport, not sure what would be the proper term here) it starts as of the beginning of the report.

So, in this case, where the report is a part of the main form as an object (subform, or subreport), how can it be forced to go to the last page on opening?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:54
Joined
Oct 29, 2018
Messages
19,135
@theDBguy, regarding your code from post #4, from what I understood, it is being used to generate comma-separated data into one string. Is that correct?
Hi. Sorry for the delay. Just to answer the above, I created a mock up table containing the sample data you provided earlier and it looks like this.
1601306362167.png


I then created a form to show you the result of two SimpleCSV() calls. The first one uses the default delimiter. The second one uses a new line character. See the difference?
1601306524311.png
 

CJ_London

Super Moderator
Staff member
Local time
Today, 15:54
Joined
Feb 19, 2013
Messages
14,685
presenting messages in clouds makes the chat more appealing
if by clouds you mean left,/right you can use the <blockquote> in richtext to shift one users messages to the right. you would probably need a setting in tblWHosOn as to which user it applies to. You can also have an 'inline header' for the chat title and use the <font style="BACKGROUND-COLOR:#FFFF00"> (#FFFF00 is yellow) for background colour

allow users to edit/delete messages
in the example, I locked the chat control so users couldn't do that (although they can still copy/paste), but you could just unlock it. Depends on the actual requirement but normally it is not a good idea to edit chats as it can destroy the flow.
 

Isaac

Lifelong Learner
Local time
Today, 07:54
Joined
Mar 14, 2017
Messages
6,678
@Acke
I was just mostly curious on one thing. Why would you want to let users Edit and Delete chat messages?
If I am a regular end-user, and I've been using various "chat" in software/website contexts for years, being able to count on and rely on the fidelity of my chat transcript is a basic expectation. Having a record of my conversation with someone that conflicts with their now-edited or now-deleted messages would be (if I were the end-user), very disturbing.
 

Acke

Registered User.
Local time
Today, 16:54
Joined
Jul 1, 2006
Messages
158
@Acke
I was just mostly curious on one thing. Why would you want to let users Edit and Delete chat messages?
If I am a regular end-user, and I've been using various "chat" in software/website contexts for years, being able to count on and rely on the fidelity of my chat transcript is a basic expectation. Having a record of my conversation with someone that conflicts with their now-edited or now-deleted messages would be (if I were the end-user), very disturbing.

In case the message goes out with the mistake, it is quicker to edit/delete then to type "please ignore last message", or similar. We are using Telegram to chat at the moment. It has the option to delete but not to edit the message. I miss edit with a telegram. During peaks with a lot of multitasking, mistakes are happening more often. If I type the telephone number wrong for example, I can just edit it, instead of sending the correct number again. I like Viber having that option as well as Skype.

What happens to me relatively often is to start typing on the wrong keyboard when in hurry, as my desktop setup is two PC sets (two keyboards, 3 monitors per PC).

The chat in our case is being used for quick and simple communication. We never go back looking at history. It is more of a temporary communication tool for us.
 

Acke

Registered User.
Local time
Today, 16:54
Joined
Jul 1, 2006
Messages
158
if by clouds you mean left,/right you can use the <blockquote> in richtext to shift one users messages to the right. you would probably need a setting in tblWHosOn as to which user it applies to. You can also have an 'inline header' for the chat title and use the <font style="BACKGROUND-COLOR:#FFFF00"> (#FFFF00 is yellow) for background colour

in the example, I locked the chat control so users couldn't do that (although they can still copy/paste), but you could just unlock it. Depends on the actual requirement but normally it is not a good idea to edit chats as it can destroy the flow.

Thanks @CJ_London. Another great idea with richtext options. What you suggest should meet all requirements. Even edit/delete could be solved in a way. Not straight forward, but it could be done.
 

Acke

Registered User.
Local time
Today, 16:54
Joined
Jul 1, 2006
Messages
158
I am just a step to finalize the chat with solutions most suitable to our needs. Is there a solution to make the report go to the last page as described in post #13?

I would really appreciate it if somebody could offer a solution to how this can be done?
 

Users who are viewing this thread

Top Bottom