smithsj1
asked on
DBLookupComboBox - Refresh
How do I get a DBLookupComboBox to show the first record of the listsource when the Table is activated.
I've tried Table1.first but the dropdown still remains blank until I have first selected an Item.
If I have a parent table a select a record the I want the dropdown to now refresh and show the new detail records as per master table record.
I've tried Table1.first but the dropdown still remains blank until I have first selected an Item.
If I have a parent table a select a record the I want the dropdown to now refresh and show the new detail records as per master table record.
ASKER
Samone do you mean
dblookupcombobox1.keyvalue :=table1.f indfield(' name').ass tring;
Why doesn't Inprise just default th lookup to show the first record.
dblookupcombobox1.keyvalue
Why doesn't Inprise just default th lookup to show the first record.
Open the 'listsource' table before the table that use the value from listsource.
Table1.open; <---- Table that has a listsource
Table2.open; <---- Table that use a listsource value.
if you entering the correct value in DBLookupComboBox property then everything must be ok as expected.
But if you still insist that you have to open the table that contain listsource open after the second table than you must add this code :
procedure TForm1.Table2NewRecord(Dat aSet: TDataSet);
begin
Table2ID.AsInteger := 1; // i assume that the first value of table1 is 1
end;
Inprise did make Dblookupcombobox show the first record.
Adeng.
Table1.open; <---- Table that has a listsource
Table2.open; <---- Table that use a listsource value.
if you entering the correct value in DBLookupComboBox property then everything must be ok as expected.
But if you still insist that you have to open the table that contain listsource open after the second table than you must add this code :
procedure TForm1.Table2NewRecord(Dat
begin
Table2ID.AsInteger := 1; // i assume that the first value of table1 is 1
end;
Inprise did make Dblookupcombobox show the first record.
Adeng.
ASKER
Adeng
Samone already answered the Q to my satisfaction.
Samone already answered the Q to my satisfaction.
Why did you reject my answer then?
ASKER
Samone
I needed to confirm what you meant.
"Samone do you mean "
"dblookupcombobox1.keyvalu e:=table1. findfield( 'name').as string; "
" Why doesn't Inprise just default th lookup to show the first record."
Submit your answer again I'll accept it now!
I needed to confirm what you meant.
"Samone do you mean "
"dblookupcombobox1.keyvalu
" Why doesn't Inprise just default th lookup to show the first record."
Submit your answer again I'll accept it now!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can try to set
DBLookupComboBox.Keyvalue:
SAM 1