Results 1 to 8 of 8
  1. #1
    murleyj is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    16

    Use form to append a text field in a record without overwriting existing text

    How can I use a form to append a text field in a table without overwriting the existing text.

    Example:

    My current text field [ApprovalComments] in a table named [DocumentControl] contains the following text:



    Rev A - approved by JBM 6/03/2014



    I would like to use a form and have it append the existing text to read:

    Rev A - approved by JBM 6/03/2014
    ______________________________

    Rev B - approved by JBM 6/04/2015


    So I have essentially preserved the existing text and added a seperating line and a new line of text.

    Can this be done?

    Thank you!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Really should have a related table for multiple comments. Each comment would be a new record.

    Otherwise, user must know to go to end of the text in the field and enter new info

    OR

    use an UNBOUND textbox and VBA code to concatenate the text strings and save the new value.

    This is a poor db design.
    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
    murleyj is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    16
    I don't have that option. I am working on a database that is part of some software. At its core is an Access database. I am interacting with this part of it using an Access form which will write to several tables at once.

  4. #4
    murleyj is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    16
    June7 what VBA code would I use? I do not know how to write that.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Something like:

    If Not IsNull(Me.textboxname) Then Me!fieldname = Me!fieldname & vbCrLf & Me.textboxname

    The real trick is figuring out what event to put the code into. Maybe the form BeforeUpdate.
    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.

  6. #6
    murleyj is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    16
    Ok, thank you. I will try it and see what I come up with.

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Wait, I goofed on code.

    Me!fieldname = Me!fieldname & IIf(Not IsNull(Me!fieldname), vbCrLf, "") & Me.textboxname
    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.

  8. #8
    murleyj is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    16
    ok, thanks. I will try it.

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

Similar Threads

  1. Replies: 0
    Last Post: 09-03-2014, 02:37 PM
  2. Replies: 1
    Last Post: 03-27-2014, 06:42 AM
  3. Replies: 3
    Last Post: 08-28-2012, 02:27 PM
  4. Display record in unbound text field on form
    By MAABDOLAT in forum Forms
    Replies: 1
    Last Post: 07-25-2012, 06:10 PM
  5. Replies: 2
    Last Post: 03-01-2012, 12:21 PM

Tags for this Thread

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