Ok, I did as you suggested. DBLookUpComboBox is filled properly, but
something's wrong with the detail dataset. Somehow the DBGrid linked to it
does not show anything (and I know there is data inside), and if you try to
insert new values when you exit the last field all values disappear and
first cell is focused and assigned the value of the DBLookUpComboBox. I
suppose the problem is that i've not assigned the field to be joined with
the DBLookUpComboBox value. But how do I this?
I'll post here the values of the properties I'm using
MasterDataSource.DataSet := MasterADODataset; //for the DBLookUpCombobox
DetailDataSource.DataSet := DetailADODataset; //for the DBGrid
DetailADODataset.MasterSource := MasterDataSource;
DetailADODataset.MasterFields := 'id_company'; //field example
DBLookUpComboBox.DataSource := nil;
DBLookUpComboBox.ListSource := MasterDataSource;
DBLookUpComboBox.KeyField := 'id_company';
DBGrid.DataSource := DetailDataSource;
Hope you can help me. Thanks for all!
"Brian Bushay TeamB" < XXXX@XXXXX.COM > escribien el mensaje
>> Since Detailfields does not exist you won't find it.
>> To use a DBLookupComboBox as a Master source
>> In Object Inspector, leave datasource and datafield blank. Set
>> ListSource to the table that has the field values you want displayed and
>> set Keyfield Field to that field.
>> Getting the dblookupcombobox to display the first record on startup is a
>> bit trickier. In my Form.Show event handler/method, do this:
>> If you don't post a wmchar message, the lookupcombobox is empty when the
>> program starts up.
>> Brian Bushay (TeamB)