Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default 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



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default 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



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Append Text in Textbox Excel Monkey[_2_] Excel Programming 1 April 20th 09 11:59 PM
vba to append to a text file hccatmo Excel Programming 5 January 13th 08 10:29 PM
Append text Jeff Excel Discussion (Misc queries) 1 February 16th 07 10:28 PM
append data from text box Qaspec Excel Programming 3 August 1st 06 06:17 PM
Text Export/Append Mr. C Excel Programming 0 January 10th 06 06:36 PM


All times are GMT +1. The time now is 06:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"