Hi All,
here is what I am trying to achieve. I have a memo field on a form which
users will need to add to as and when. I do not want them to be able to edit
information which already exists within this field.
My idea was to have the memo field locked on the form to stop edits.
Place a command button by the memo field which opens an unbound form with a
single text box.
The user enters their update into the unbound form and upon closing it, the
text they entered will be added to whatever information already exists
within the memo field.
I have tried running the following code upon click a command button on the
unbound form:
On Error GoTo UpdateMemoError
Dim strSQL As String
strSQL = "UPDATE tbl_IRS SET tbl_IRS.Details = " & _
"(SELECT tbl_IRS.Details FROM tbl_IRS " & _
"WHERE (((tbl_IRS.IR_Number)=[forms]![frm_IR_Entry]![IR_Number]));) &
[forms]![frm_memo_Update]![xt_Addition] " & _
"WHERE (((tbl_IRS.IR_Number)=[forms]![frm_IR_Entry]![IR_Number]));"
DoCmd.RunSQL strSQL
UpdateMemoExit:
Exit Sub
UpdateMemoError:
Debug.Print "Error Description: " & Err.Description & vbCrLf & _
"Error Number: " & Err.Number
Resume UpdateMemoExit
but recieve the following error:
Error Description: Invalid Memo, OLE, or Hyperlink Object in subquery
'tbl_IRS.Details'.
Error Number: 3342
The help file says "
A subquery cannot return a Memo or OLE Object, and it cannot be compared to
a Memo or OLE Object in an expression." but I can't think of another way to
do this :o(
Am I barking up the wrong tree in the way I am trying to do this or is it
simply my syntax is incorrect?
TIA,
Mark