Results 1 to 6 of 6
  1. #1
    Nadine67 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    55

    Transfer, timestamp and lock comments

    Hello and thank you in advance for any attention this post may receive

    I am running MS Access 2010 on Windows XP.

    I have a form called 'Capture Form' and on it are two text boxes - Comments and Comments History. Comments is a Memo data type which is in table 'Improvement ideas'. Comments History does not appear in any table - should it?

    Comments will be entered into 'Comments' and upon saving the form the text from 'Comments' will clear and be timestamped and entered into 'Comments History'. Each time comments are added to a record the same will happen yet it will append to the existing historical comment in 'Comments History'.

    The Control Source for Comments History is =ColumnHistory([RecordSource],"Comments","[ID]=" & Nz([ID],0))

    When I am in Form View I can enter comments into 'Comments' text box - great. 'Comments History' text box has #Error in it.



    Where have i gone wrong?

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,840
    Sounds like you are not using the feature as intended - take a look at these links

    http://www.fmsinc.com/MicrosoftAcces...tory/Index.asp
    https://support.office.com/en-us/art...7-c2bb6283535a

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by Nadine67 View Post

    Comments is a Memo data type which is in table 'Improvement ideas'. Comments History does not appear in any table - should it?

    Comments will be entered into 'Comments' and upon saving the form the text from 'Comments' will clear and be timestamped and entered into 'Comments History'
    .
    If your explanation is correct, I've done this before, in a situation where you don't want users to be able to edit a comments Field, but only add subsequent comments, to correct an entry, if necessary. And if our explanation is correct...you've got everything backwards!

    The 'Comments' Field should be Unbound (not in any Table) and the 'Comments History' Field should be Bound to a Field in the underlying Table! After all, it's the 'Comments History' that you want saved and available, at a later date!

    Linq ;0)>

  4. #4
    Nadine67 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    55
    Thank you to both of you for your help.

    So Linq I have done what you suggested but am not sure how to get my 'comments' to append with a timestamp in 'comments history'.

    Cheers nadine

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Here's a tutorial I wrote a number of years ago in response to someone with similar requirements; hopefully it'll help you.

    In this example, there are two Memo Field Textboxes, but only one is Bound, since the other one is simply a temporary holding area. The Bound Memo Field Textbox, named CommentsField, here, must have its Locked Property set to Yes/True, so that all data entry has to be done through the temporary Textbox.

    TempDataBox is Unbound, and in the Property Pane its Visible Property must be set originally set to 'No.' I place mine side by side with the CommentsField Textbox so that the user can refer to what's currently in the CommentsField Textbox while entering new notes.

    Once again, the CommentsField Textbox is Bound to the Form's underlying Table/Query, and its Locked Property is set to 'Yes.'

    Place a Command Button on the Form. Name it IndirectDataInput and in the Properties Pane set its Caption to "Add New Data"

    Now use this code:

    Code:
    Private Sub IndirectDataInput_Click()
    If IndirectDataInput.Caption = "Add New Data" Then
       TempDataBox.Visible = True
       TempDataBox.SetFocus
       IndirectDataInput.Caption = "Commit Data"
    Else
       IndirectDataInput.Caption = "Add New Data"
       If IsNull(Me.CommentsField) Then
          If Len(Me.TempDataBox) > 0 Then
            Me.CommentsField = Now() & "  " & Me.TempDataBox
            Me.TempDataBox = ""
            TempDataBox.Visible = False
          Else
            TempDataBox.Visible = False
          End If
        Else
          If Len(Me.TempDataBox) > 0 Then
           Me.CommentsField = Me.CommentsField & vbNewLine & Now() & "  " & Me.TempDataBox
           Me.TempDataBox = ""
           TempDataBox.Visible = False
     
          Else
           TempDataBox.Visible = False
          End If
          
        End If
    End If
    End Sub


    So, you click on the Command Button, the temporary Textbox appears, you enter your new data, click the Button again, the data is added to the Memo Field Textbox, and the temporary Textbox disappears.

    You'll have to replace CommentsField, in the code above, with the actual name of the Textbox on your Form that is Bound to your Memo Field.

    Linq ;0)>

  6. #6
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,840
    @Linq - I think the OP is asking about the memo history available from access 2010 - a new property called append only (right at the bottom of the field properties, you usually have to scroll down to see it)

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

Similar Threads

  1. Replies: 6
    Last Post: 04-09-2015, 08:57 PM
  2. Need your comments regarding HR database
    By wrkadri in forum Database Design
    Replies: 2
    Last Post: 07-05-2014, 06:19 PM
  3. Comments on Reports
    By John99 in forum Access
    Replies: 1
    Last Post: 11-12-2012, 09:51 AM
  4. Comments History
    By stu in forum Forms
    Replies: 3
    Last Post: 11-15-2011, 06:43 PM
  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