Memo Fields

mrssevans

Registered User.
Local time
Today, 14:45
Joined
Nov 15, 2001
Messages
190
I am needing to disallow deleting in a notes field. Is that possible?
 
You can lock the control but you can't disallow deletes for a specific control, only the entire form. You could use some code to lock the control after the initial AfterUpdate event... and then unlock the control upon selecting a new record...

Mitch
 
OOPS!! Double posted...

frown.gif


Mitch

[This message has been edited by Mitch_____W (edited 05-14-2002).]
 
That's a great idea. Could you suggest some code to get me started. Kind of new to VB. THanks in advance, Sam
 
I situations where I don't want a memo field to be touched by deleting/editing of what has been entered I use the following.

1 unbound text box for entering the new comment.

1 command button to append the text at the end of the memo field.

1 Locked and Disabled Text box bound to the memo field.


Button Code:

Me.[BoundMemoField]=Me.[BoundMemoField] & iif(Me.[BoundMemoField]<>"",vbcrlf & vbcrlf,"") & Time() & ": " & Me.[UnboundTextBox]

I add the Time() function for a Date/Time Stamp
 
How could I use the above code, which works great by the way, to start at the beginning if I have the field diabled? Instead of starting at the end I would like to start at the beginning.
Also, I have the field set to Enable=no because when I had it locked, when the user enters a note it is not saved in the table. Here is my problem, it is hard to read the information if the field is greyed out. Any suggestions?
Thanks

[This message has been edited by mrssevans (edited 05-15-2002).]
 
Look up SelStart in the archives or Access help.
 
Me.[BoundMemoField]=Time() & ": " & Me.[UnboundTextBox] & iif(Me.[BoundMemoField]<>"",vbcrlf & vbcrlf,"") & Me.[BoundMemoField]

will place the info at the top.

Use Enabled=False and Locked=True together. This will have a normal apperance and prevent users from adding data.
 
Thanks everyone some of the suggestions work great. The only thing now is that when I use the last suggestion it copies everything in the notes and places all of that on the top of the others. How do I stop the duplication and just place the new notes on the top?
 
Travis' suggestion should insert the new note at the top of the Notes field. Isn't that what you asked?
 
It does put the notes first, but it copies all the notes again. So if I have 5 notes plus the new one I am entering it makes that 11 notes. Any suggestions.
 
I tested the code again and do not find it doing what you say it is. Can you copy the code you are using so that we can see it?
 

Users who are viewing this thread

Back
Top Bottom