Edit But Not Delete Comments

Neilbees

Registered User.
Local time
Today, 09:16
Joined
Oct 30, 2006
Messages
51
Hi. Again, apologies for starting a new thread but I can't find a solution via the search.

I have a comments box on a form that users need to be able to update but not delete anything already entered in it. In other words, they can add new comments to a record but not delete old comments, in the same comments box. Is this possible?

Thanks, as always.
 
I've done this by creating a popup form that the user adds new comments in and then when he closes it the new comments get concatenated to the end of the existing comments. Of course the you have to set the original comments box to read only...

:)
ken
 
Here's a routine I use. It assumes that the comments field is a memo field, but, of course, it could also be a regular text field. It also includes spell checking. If you don't want this, post back and I'll strip the code for this out and repost it.

Place a button on your form and name it InputData. In the Caption Property enter Input New Notes.

Place a second textbox on your form, besides the target textbox. Name it YourMemoFieldInput. In the Properties box set its Visible Property to No.

Then, as Ken said, go into the Properties box and set the Locked Property for your original "display" textbox to Yes.

Code:
Private Sub InputData_Click()
If InputData.Caption = "Input New Notes" Then
   YourMemoFieldInput.Visible = True
   YourMemoFieldInput.SetFocus
   InputData.Caption = "Add New Notes"
Else
  If Len(YourMemoFieldInput.Value) > 0 Then
    DoCmd.SetWarnings False
    YourMemoFieldInput.SetFocus
    YourMemoFieldInput.SelStart = 1
    YourMemoFieldInput.SelLength = Len(YourMemoFieldInput.Value)
    DoCmd.RunCommand acCmdSpelling
    YourMemoFieldInput.SelLength = 0
    DoCmd.SetWarnings True
    YourMemoField.SetFocus
    Me.YourMemoField = Me.YourMemoField & " " & Me.YourMemoFieldInput & " " & Now
  End If
   InputData.Caption = "Input New Notes"
   Me.YourMemoFieldInput = ""
   YourMemoFieldInput.Visible = False
End If
End Sub
 
This is absolutely brilliant guys, can't tell you how appreciated it is!
 

Users who are viewing this thread

Back
Top Bottom