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

Appending notes from one field to another error message appearing

P: n/a
I have a problem in appending notes from a new notes memo field to one
that is read-only, i.e., field enabled, but locked. I have seen many
messages touching on this subject but cannot find the correct answer.

The code I am using on the 'Post New Notes" command button is:

Private Sub Command496_Click()
If IsNull(NewNotes) Then Exit Sub ' does not append blank note
DoCmd.OpenQuery "PostIssueNotes" 'appends current note
Comment.Refresh 'shows the newly-appended note
NewNotes = Null 'blanks out new note, since it was just appended to
End Sub

I am getting "Method or Data Member not found."" for the
Comment.Refresh line and do not know how to resolve it. The query is
finding the information for the correct record, but nothing is being
appended to the read-nly memo field.

I have an afterupdate event procedure so that the date precedes the
posting of the new message as follows:

Private Sub Text184_AfterUpdate()
[Comment] & "" Date() & "" & [Forms]![Issues]![NewNotes]
End Sub

Is after update the proper location for this or should it be somewhere
else? And, is this causing the error?

Any assistance would be appreciated.


Apr 26 '06 #1
Share this Question
Share on Google+
2 Replies

P: n/a
If the field is locked, you can unlock it in code, append to it, and
then re-lock it.


Say I have two fields on my form:
txtNewNotes, which is text(255)
and another
txtMemoNotes, which is a memo field in the underlying table

txtShortNote is editable, and txtMemoNotes is not and is locked

To append the contents of Me.txtShortNote to Me.txtMemoNotes, I could
do somethign like this:

Sub cmdAppendToMemo()
dim blnEnableEdits as boolean

'---Enable edits
me.txtMemoNotes.Locked= Not blnEnableEdits

'--Commit edits to "log" field.
me.txtMemoNotes=me.txtmemoNotes & vbcrlf & Now() & vbcrlf &

'--Disable edits

me.txtMemoNotes.Locked= Not blnEnableEdits
End Sub

but you would have to put code in the OnCurrent event fo your form to
re-enable some fields, if you need to use them, or they would remain
locked (by your form).

Hope that didn't just confuse matters!


Apr 26 '06 #2

P: n/a
Thank you for the reply. It is a bit confusing, though I see what you
are leading to. Where does the code get placed, i.e., which control or
is ti the form itself? By the way, new notes is a memo field, not a
text box.


Apr 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.