Please Help: Append New text to old text

S

sam

Hi All,

I have a form which populates access database.

On the form Once we input a student Id, we can input student records and
also add comments, after making the changes we click "Submit" and the data
goes in the databae.
One field that I have on the form is "Comments" Textbox whereTA can insert
their comments for any student.
Here multiple TA's can comment for one student. The issue I want to resolve
is. When a new TA inserts a comment, Old comments are deleted and replaced by
the new comments. Is there a way to append new comments to old comments and
not delete the previous comments made by other TA's?

Hope I made it clear.

Thanks in advance
 
L

Linq Adams via AccessMonster.com

Working with medical/legal records, I use this method to add notes without
the user being able to delete or edit previously entered notes. In this hack
a second, unbound textbox (TempDataBox) is used to enter the data into. This
textbox is originally hidden, and when the command button (IndirectDataInput)
is clicked, it appears. Data is entered, and when the command button (now
captioned “Commit Dataâ€) is clicked again, the entered data is added to the
memo field.

Now, in this example, there are two memo fields, but only one is bound, since
the other memo field is simply a temporary holding area. The memo field is
also locked so that all data entry has to be done thru the temporary textbox.

TempDataBox is unbound, and in the Property Box its Visible Property is set
originally set to No. I place mine side by side with CommentsField so the
user can refer to what's currently in the CommentsField section while
entering new notes.

CommentsField is bound to the 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 Box set its Caption to “Add New Data.â€

Now use this 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 = 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 & Me.TempDataBox
Me.TempDataBox = ""
TempDataBox.Visible = False
Else
TempDataBox.Visible = False
End If

End If
End If
End Sub
 
J

John W. Vinson

Hi All,

I have a form which populates access database.

On the form Once we input a student Id, we can input student records and
also add comments, after making the changes we click "Submit" and the data
goes in the databae.
One field that I have on the form is "Comments" Textbox whereTA can insert
their comments for any student.
Here multiple TA's can comment for one student. The issue I want to resolve
is. When a new TA inserts a comment, Old comments are deleted and replaced by
the new comments. Is there a way to append new comments to old comments and
not delete the previous comments made by other TA's?

Hope I made it clear.

Thanks in advance

I would pretty strongly suggest that you change your table design to
accommodate this need, rather than jamming a lot of unrelated comments into a
single Memo type field. Consider a Comments table with fields CommentID
(autonumber primary key), StudentID (a link to the students table),
CommentDate (date/time, default value =Now() to capture the date and time that
the comment was entered), TAID (to record who made the comment), and Comment
(the memo field for the actual comment). This can be displayed on a Subform;
it will let the TA identify themselves by selecting their name from a combo
box, enter the comment, and have it automatically timestamped and linked to
the student data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top