ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Please Help: Append New text to Old text already present in databa (https://www.excelbanter.com/excel-programming/441580-please-help-append-new-text-old-text-already-present-databa.html)

Sam

Please Help: Append New text to Old text already present in databa
 
Hi All,

I have an excel form which populates access database.

On the form Once we input a student Id in the form, 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

JLGWhiz[_2_]

Please Help: Append New text to Old text already present in databa
 
You should be able to add to the text box content by clicking in the display
window to activate the insertion point (cursor), then type in additional
data.

You can use the properties dialog box to set Multiline to True. Then the
user can press Ctrl + Enter to make a linefeed and carriage return to add a
new line of data.

Not sure what the limit is on characters for a textbox, but there is one.
Probably 255.


"sam" wrote in message
...
Hi All,

I have an excel form which populates access database.

On the form Once we input a student Id in the form, 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




JLGWhiz[_2_]

Please Help: Append New text to Old text already present in databa
 
After reading your post again, you should disregard my original answer. It
was based on amending text before the form is executed.

To do what you want, you would have to amend the code that posts the data to
Access so that it adds to the comments rather than replacing them. Without
seeing the current code, it is impossible to offer a better solution.




"sam" wrote in message
...
Hi All,

I have an excel form which populates access database.

On the form Once we input a student Id in the form, 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




Sam

Please Help: Append New text to Old text already present in da
 
HI JLGWhiz,

Here is my code to get data from excel form into access:

Dim r as integer, cn As Object, rs As Object

Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")

cn.Open "Provider=Microsoft.ACE.OLEDB.12.0; " & _
"Data Source=C:\Students\Students_Data.accdb; Jet OLEDB:Database
Password=stu1123; "

rs.Open "Students_Data_Table", cn, 1, 3, 2

With rs
.Addnew

.Fields("Student_Number") = Me.StudentNo.Value
.Fields("Student_FName") = Me.FName.Value
.Fields("Student_LName") = Me.LName.Value
.Fields("Student_Major") = Me.Major.Value
.Fields("Student_Level") = Me.Level.Value
.Fields("Student_Age") = Me.Age.Value
.Fields("Comments") = Me.Comments.Value

.Update
End With
r = r + 1

Set cn = Nothing
Set rs = Nothing

Thanks in advance

"JLGWhiz" wrote:

After reading your post again, you should disregard my original answer. It
was based on amending text before the form is executed.

To do what you want, you would have to amend the code that posts the data to
Access so that it adds to the comments rather than replacing them. Without
seeing the current code, it is impossible to offer a better solution.




"sam" wrote in message
...
Hi All,

I have an excel form which populates access database.

On the form Once we input a student Id in the form, 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



.


JLGWhiz[_2_]

Please Help: Append New text to Old text already present in da
 
I know very little about Access programming, but this might work:

.Fields("Comments") = Fields("Comments").Value & _
";" & Me.Comments.Value


The syntax might not be right, but concantenation seems to be the answer.
One problem might be that in Access the data field would be limited in
characters that could be entered.


"sam" wrote in message
...
HI JLGWhiz,

Here is my code to get data from excel form into access:

Dim r as integer, cn As Object, rs As Object

Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")

cn.Open "Provider=Microsoft.ACE.OLEDB.12.0; " & _
"Data Source=C:\Students\Students_Data.accdb; Jet OLEDB:Database
Password=stu1123; "

rs.Open "Students_Data_Table", cn, 1, 3, 2

With rs
.Addnew

.Fields("Student_Number") = Me.StudentNo.Value
.Fields("Student_FName") = Me.FName.Value
.Fields("Student_LName") = Me.LName.Value
.Fields("Student_Major") = Me.Major.Value
.Fields("Student_Level") = Me.Level.Value
.Fields("Student_Age") = Me.Age.Value
.Fields("Comments") = Me.Comments.Value

.Update
End With
r = r + 1

Set cn = Nothing
Set rs = Nothing

Thanks in advance

"JLGWhiz" wrote:

After reading your post again, you should disregard my original answer.
It
was based on amending text before the form is executed.

To do what you want, you would have to amend the code that posts the data
to
Access so that it adds to the comments rather than replacing them.
Without
seeing the current code, it is impossible to offer a better solution.




"sam" wrote in message
...
Hi All,

I have an excel form which populates access database.

On the form Once we input a student Id in the form, 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



.





All times are GMT +1. The time now is 09:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com