BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TDBLookUpComboBox

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using
View previous topic :: View next topic  
Author Message
Will
Guest





PostPosted: Fri Nov 28, 2003 10:48 pm    Post subject: TDBLookUpComboBox Reply with quote



I'm using a TDBLookUpComboBox to get an ID from one table, to use as a
Filter on another table, whose contents then get displayed in a grid.

However, one of the ID's does not have a corresponding record in the table
to be displayed in the grid. Not a problem...or it shouldn't be. But
somehow, the TDBLookUpComboBox.KeyValue gets set to Null, and even by
selecting another item that does have a correspnding record, I can't get
back to a non-Null value.

The grid I am using is TMSSoftware's TDBAdvStringGrid, since it is the only
grid I have that allows me to easily check a value just before it is drawn,
and reformatting it the way I want.

Below is the code:

procedure TfrmItemSelector.luClientLookUpCloseUp(Sender: TObject);
begin
dmAssign.tblDetails.Filter := 'DCLIENTID LIKE ''%' +
luClientLookUp.KeyValue + '%''';
dmAssign.tblDetails.Filtered := True;
end;

procedure TfrmItemSelector.grdClientGetDisplText(Sender: TObject; ACol,
ARow: Integer; var Value: String);
var
d:TDate;
begin
if Value <> '' then
if (ACol = 2)and (arow > 0) then
begin
try
d := StrToFloat(Value);
except end;
Value := FormatDateTime('mmm dd, yyyy', d);
end;
end;

That's it. The IB components are in a data module and are set up at design
time(for now).

Thanks.

--
Will


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.