By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,002 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

Appending to Memo Field

P: n/a
PMB
Thank you in advance for any and all assistance.

In a Form AfterUpdate Event I'm trying to first check and see if there is
data in a memo field, if there is, I want to move to the end and append
additional data to the next line of the memo field.
Form Name: Transactions
SubForm Name: TransactionsDetails

memo1 is the field name

Thank you,

Michael
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
A memo field is a datatype in a table. What you want to do is to update
a field in a table which is a memo field. The table is most likely the
underlying table of your subform. So in some AfterUpdate event on your
main form you can update this field as follows:

Private Sub something_AfterUpdate()
Dim RS As Recordset, frm As Form, m As Long, str1 As String
set frm = Me.yoursubform.Form
Set RS = frm.RecordsetClone
m = frm.CurrentRecord
RS.MoveFirst
RS.Move(m - 1)
str1 = RS!Memofld
If str1 <> "" Then
str1 = str1 & " " & mainform!txtMemo
RS.Edit
RS!Memofld = str1
RS.Update
frm.Requery
End If
End Sub

This routine moves to the record you are currently on. I believe there
is a better way to move to the current record in the recordsetclone
object than what I am showing. I just can't think of it right now. But
this should work. The frm.Requery line should update the main form and
subform to show the change.

Rich
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #2

P: n/a
How about: me!Memomfield = me!Memofield & NewText

PMB wrote:

Thank you in advance for any and all assistance.

In a Form AfterUpdate Event I'm trying to first check and see if there is
data in a memo field, if there is, I want to move to the end and append
additional data to the next line of the memo field.

Form Name: Transactions
SubForm Name: TransactionsDetails

memo1 is the field name

Thank you,

Michael

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.