Results 1 to 13 of 13
  1. #1
    sparker75 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Jul 2018
    Posts
    107

    @username in comments

    Hello,

    I would like to build a commenting system in my database so that users can make comments on work orders and tag other users (@username) within the comment. It would be nice to have it auto complete as I start to type the username @scp



    Has anyone ever implemented this before or have any suggestions on the best way to do this is?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Would require VBA looping through list of usernames and searching the comment for a match. This would be after the comment is fully entered. I don't really see any practical method to do what you ask.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    sparker75 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Jul 2018
    Posts
    107
    So if I was to start typing @ in the comment it would look in the user table for the user and autofill as they type. This would also prevent a user from being tagged that does not exist in the user table

    For searching through comments could I create a query to look for the current logged in user for their username in the comment? This could create a list of comments that have been tagged with my username.

    It would be a interesting way for our team to communicate issues to eachother

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    As I said, no practical way to conduct this find as you type to autofill just the username in middle of a string. Take a look at http://allenbrowne.com/AppFindAsUType.html

    The looping and search I described was to find username and insert the @ character prefix. On the other hand, code can parse the comment to find all instances of @ character then grab the following characters to see if there is a match in the users table and if no match found, popup a message to user to edit comment. Either concept will be complex code.

    Yes, a query could filter records with username as criteria.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    If your system has a login requirement, then you could put that username in a TempVar at login and anytime they create a comment, you could automatically identify/record the user who posted the comment.

  6. #6
    sparker75 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Jul 2018
    Posts
    107
    My system is using the computer username instead of login. The first time you open the application you are required to add First, Last Name, Extension, Email, Company and Department. You are then set a temp access level that will give you access to only a few tabs on the nav form. The admin will then assign the correct user group and the correct tabs open up to them. I hate logins

    But with this commenting system I record the initiator username in the comment record. But I would like the user to be able to add other users to the comment. For now I created a tabular form that will list out all comments that have their @username in the comment. They will then be able to respond to that comment.

    It would be nice to enforce that the @username is a valid user in the tblusers when the person is typing the comment.

  7. #7
    sparker75 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Jul 2018
    Posts
    107
    When the user clicks the "Respond" button it will open a form creating a new record in the tblcomment and populate the Order and add @username (which is the Initiator of the comment) in the comment box. How would code the Respond button?

    Click image for larger version. 

Name:	Capture.JPG 
Views:	28 
Size:	69.7 KB 
ID:	35226

  8. #8
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    What about a continuous sub form with comboboxes or a multiselect listbox.

  9. #9
    sparker75 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Jul 2018
    Posts
    107
    This is my input form when the user clicks respond. I just need to know how the Respond button VBA code would populate the Workorder, Initiator and Comment boxes when the input form opens.

    Click image for larger version. 

Name:	Capture.JPG 
Views:	29 
Size:	23.0 KB 
ID:	35227

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    The respond form is to generate an email?

    What table is this form bound to? As Mike said, perhaps a subform. That will automatically populate work order ID. Code in form Current event can grab initiator ID. Where would the comment come from?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    sparker75 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Jul 2018
    Posts
    107
    The respond form is to add a new comment to the table. This form is bound to tblTransactionComment. The comment is what the user would type.

    Right now when they click respond it opens the form so that they can make a new comment. I would prefer this form to pop up instead of a subform.

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Then have to pass work order ID to the form. Common method is OpenArgs of DoCmd.OpenForm. Then code behind called form like:

    If Not IsNull(Me.OpenArgs) Then
    'Code here to move to New Record row (or an UNBOUND form and use INSERT action to save data) and set value of work order and user textboxes/fields.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    sparker75 is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Jul 2018
    Posts
    107
    Hi June, Would you be able to provide me an example.

    Fields that I would like to populate from one form to the next are OrderNum, UserName (This is the logged in user) and Comment (This would be who created the first comment and displayed as @username) I appreciate your help with this

    If Not IsNull(Me.OpenArgs) Then




Please reply to this thread with any new information or opinions.

Similar Threads

  1. Comments Box with Username
    By David Bratby in forum Forms
    Replies: 3
    Last Post: 11-17-2015, 05:10 PM
  2. Replies: 14
    Last Post: 08-17-2015, 02:32 AM
  3. Replies: 6
    Last Post: 04-09-2015, 08:57 PM
  4. Comments on Reports
    By John99 in forum Access
    Replies: 1
    Last Post: 11-12-2012, 09:51 AM
  5. Comments box
    By allykid in forum Forms
    Replies: 1
    Last Post: 07-12-2010, 08:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums