I have a rather strange issue about which I am having trouble finding documentation. I have a Delphi program that uses Delphi's built-in TDBMemo component, as the component needs to pull data from a field in a database. The user must also be able to edit this information, namely add information to the component's field. Text typed to the field is visible and does not disappear; however, that is not my problem.
The form gives the user the option to post pre-defined comments from a list, accessed through the equivalent of a pop-up triggered by a TBitButton; however, once the selected text is added to the TDBMemo and the user clicks anywhere, the added values disappear - again, not the typed text.
Here is the code for the assignment:
var NoteString: String;
if DBMemo1.Text <> '' then
begin
NoteString := frmSelectNoteCodeView.GetTextfromField + ' - ' + User.ID
+ ' on ' + FormatDateTime('mm/dd/yyyy', Now);
DBMemo1.Text := dbedComments.Text + #13#10 + NoteString;
end;
This is purposefully a code fragment (if the field is blank, the value is just assigned). I am posting this code fragment as I believe this is where the issue is, i.e. that a regular assignment cannot be used with TDBMemo?
Here's the thing: there are no events dealing with user clicks. Any ideas as to why the posted text disappears?