I have a text box on a form its control source is a memo field from my table.
I need the user to add info into the text box, but I don't want them to be able to delete any of the data that is there already.
In the BeforeUpdate event procedure check the Value against the OldValue:
If Left(yourTextBox, Len(yourTextBox.OldValue)) <> yourTextBox.OldValue Then
MsgBox "your message"
Cancel = True
Exit Sub
End If
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
Don't think you can do that -- exactly. Once you give a user access to edit the data in the text box, they will be able to add/delete/change it.
So, try a work-around. Keep your memo field text box locked and create another text box that you allow the user to edit. You should be able to make them look like one large text box on the screen. At whatever point you would normally save the data, concatenate the two -- me.textbox1 = me.textbox1 & " " & me.textbox2.
I worked a little slower than randy700, but I'll post this anyway.
Probably the easiest way to do this is to use 2 fields. One field would display the existing memo field data and should be disabled or at least locked. The other field would be an unbound field where the user makes his entry. In the process of updating the form, the unbound field would then be appended (via code) to the existing memo field.
One thing to be aware of, is that an unbound field does not "dirty" the form and therefore will not trigger an update event. You will have to create a positive means of saving the record changes such as adding a "Save Record" button and procedure. This has a secondary benefit in that the user can verify his entry before saving as he will not be able to edit it after the fact.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.