Hi all,
I have a form (frm_OrderDetails) with a subform (subf_LineItems) in a subform control (LineItems). The subform is in datasheet mode. In the Line Item table (tbl_LineItems), there is a field for comments (LineComments). Since the comments can be rather long sometimes, I wanted an easier way to display/enter/edit then that having the person scrolling on the datasheet view for each line.
I have an unbound text box (txtLineCommentLink) on my main form that is linked through VBA to the LineComments field. Everything seems to work correctly - displaying/updating but when I close out of my main form I get an error message. This only happens when I make edits to the txtLineCommentLink box. Despite the error, the changes are being saved. Does anyone have any ideas on a solution around this error message? I don't want to confuse my end users.
Error Message:
"The expression you entered requires the control to be in the active window."
Code:
This is on the AfterUpdate event for the unbound textbox on my main form.
Code:
Private Sub txtLineCommentLink_AfterUpdate()
Me.[LineItems].Form![LineComments] = Me.txtLineCommentLink
End Sub
This is in the Current event on my subform, subf_LineItems
Code:
Private Sub Form_Current()
Me.Parent.[txtLineCommentLink] = Me.LineComments
End Sub