Results 1 to 6 of 6
  1. #1
    Pada is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2023
    Posts
    22

    MS Access Long Text field shows hashtag ####

    [COLOR=var(--black-200) !important][COLOR=var(--theme-body-font-color) !important]0

    [/COLOR]
    [/COLOR]

    I have searched the solution for my MS Acccess hashtag (#'s) issue showing up in my Long Text field, I have originally posted my question at,
    https://stackoverflow.com/questions/...-shows-hashtag

    but I have not got an answer and am looking for more experts to help me.

    I have a Current Comment (txtCurComment) field (Long Text) on a form that allow users to enter a comment. A current date will be inserted in the front of that comment automatically. Next to this field, I have a button, Archive Comment, when clicked the Current Comment will be added into the Archived Comment (txtComments) (Long Text) field below it. The Current Comment field then will be cleared out to be ready for new current comment. Users can then enter next comment and so on. For some reasons, some of my users get the hashtags (#'s) into these fields instead of their comments.
    No format in the Properties of the Current Comment and Archived Comments fields. I use MS Access 2016.

    Codes for the Current Comment field (Got Focus and Lost Focus events)

    Private Sub txtCurComment_GotFocus()
    If Not Left(Me.txtCurComment, 8) = Format(Date, "MM/DD/YY") Then
    Me.txtCurComment = Format(Date, "MM/DD/YY") & ": " & Me.txtCurComment
    End If
    End Sub

    Private Sub txtCurComment_LostFocus()
    If Me.txtCurComment = Format(Date, "MM/DD/YY") & ": " then
    Me.txtCurComment = Null
    End If.
    End Sub

    Codes underlying the Archive Comment button.

    Private Sub btnArchiveComment_Click()
    Me.txtComments = Me.txtCurComment & " " & Me.txtComments
    Me.txtCurComment = Null
    End Sub

    Everything seems working. I have no idea why the hashtags are showing up in those comments
    fields to some users. These fields have long text datatype that should be fine with comments
    messages.

    Can experts please help? Thank you so much in advance.



    Last edited by Pada; 09-17-2023 at 08:55 PM. Reason: cross posted

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Why use this to add comments.

    Why not just use a Continuous Subform and then there is no need for the VB Event
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  4. #4
    Pada is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2023
    Posts
    22
    Quote Originally Posted by mike60smart View Post
    Why use this to add comments.

    Why not just use a Continuous Subform and then there is no need for the VB Event
    Thank you, mike60smart for your idea. I will study the continuous subform as I am not familiar with it. I have inherited this database and encountering the issue. I think users want it that way. They want enter today's comment, archive it and then later they go back to add updates and they want to see what has happened so far.

    Do you think using continuous subform can eliminate the hashtags?

    Thank you,

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Before you add the text, use Replace() to remove any # ?

    That could be a workaround if you cannot get to the bottom of it?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    Pada is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2023
    Posts
    22
    Hi Welsgasman,
    Thank you for your idea. I will consider using the Replace() function.

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

Similar Threads

  1. Replies: 8
    Last Post: 01-07-2020, 12:28 PM
  2. Replies: 4
    Last Post: 11-04-2019, 06:53 PM
  3. Replies: 24
    Last Post: 03-12-2019, 08:02 PM
  4. Replies: 12
    Last Post: 09-12-2018, 04:15 AM
  5. Replies: 11
    Last Post: 10-08-2012, 07:27 PM

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