Hello,
I would like to append lines of text to a form bound textbox when a button is pressed.
I’m using the following code to move the cursor to the end of the text and append a line.
Issue: the carriage return the user adds after each line is inserted gets removed each time the code is executed. The only way the carriage return is preserved, if I force save record with DoCmd.RunCommand acCmdSaveRecord. However, the user doesn’t like to press “Save Record” each time a line is inserted.
I’ve tried to suppress the save record prompt but it didn’t work.
Do you have any suggestions on how to make this work?
Thanks,
Mila
I would like to append lines of text to a form bound textbox when a button is pressed.
I’m using the following code to move the cursor to the end of the text and append a line.
Code:
With Me.CommentTxt
.SetFocus
.Value = .Value & final_citation & chr(13) & chr(10)
'.SelStart = Len(.Value)
End With
Issue: the carriage return the user adds after each line is inserted gets removed each time the code is executed. The only way the carriage return is preserved, if I force save record with DoCmd.RunCommand acCmdSaveRecord. However, the user doesn’t like to press “Save Record” each time a line is inserted.
I’ve tried to suppress the save record prompt but it didn’t work.
Do you have any suggestions on how to make this work?
Thanks,
Mila