Objective:
- Click on the button on the TRxDBCombo to call a search box
- On Selecting the record from search box, the result is set as Field Value for the TComboEditBox and is posted in the TRxMemoryData Dataset
The Error:
Dataset not in Insert or Edit Mode appears the second time of calling this function
TDBEditBox1.SetFocus;
Form_Search:= TForm_Search.Create(Application);
with Form_Search do
Begin
showmodal;
//Get Result from Database
if trim(TempResult) <> '' then
Begin
TDBEditBox1.Field.Value := MResult;
End;
End;
The setup includes:
- A TJvDBGrid with the Data Source connected to a TDataSource
- The TDataSource is Connected to a TRxMemoryData
- A TRxDBComboEdit with its Data Source set to the TDataSource in step 2 above
Please assist
DBEditBox1
and notTBEditBox1
, BTW.) The obvious solution is to put the dataset (the table attached to theDBEditBox1.Field
) in eitherInsert
orEdit
mode before trying to assign a value to the field. – Gnat