Looking for work? Check out our jobs area.
*/
*/

Read Post

Delphi beginners

Moderators: netgert
Number of threads: 292
Number of posts: 885

This Forum Only
Post New Thread

Report
Problem with a DBlookupcombo box Posted by SilencioS on on 28 Mar 2008 at 4:49 PM
On one of my forms I have 3 DBlookupcombo boxes which filter a table on their dropdown event, the problem is that only one of them actually work correctly. When I select a value in one of the others it highlights ALL the values in the dropdown menu at once so that the dropdown menu always selects the first value in the list no matter where I click.

here is the code behind the boxes, the first one is the one that works correctly:

begin
        Adobooks.Filtered:=False;
        Adobooks.filter:='TitleofBook=' + QuotedStr(SGLoan.Cells[0,1]);
        AdoBooks.Filtered:=True;
        AdoItems.Filtered:=False;
        AdoItems.filter:='OnLoan=' + 'False AND BookID=' + inttostr(AdoBooksBookID.value) ;
        AdoItems.filtered:=True;
end;

procedure TLoanForm.DBLCBook2DropDown(Sender: TObject);
begin
        Adobooks.Filtered:=False;
        Adobooks.filter:='TitleofBook=' + QuotedStr(SGLoan.Cells[0,2]);
        AdoBooks.Filtered:=True;
        AdoItems2.Filtered:=False;
        AdoItems2.filter:='OnLoan=' + 'False AND BookID=' + inttostr(AdoBooksBookID.value);
        AdoItems2.filtered:=True;
end;

procedure TLoanForm.DBLCBook3DropDown(Sender: TObject);
begin
        Adobooks.Filtered:=False;
        Adobooks.filter:='TitleofBook=' + QuotedStr(SGLoan.Cells[0,3]);
        AdoBooks.Filtered:=True;
        AdoItems3.Filtered:=False;
        AdoItems3.filter:='OnLoan=' + 'False AND BookID=' + inttostr(AdoBooksBookID.value);
        AdoItems3.filtered:=True;
end;


I am using Delphi 7.

I have no idea what could be causing this so any suggestions on how to fix it would be appreciated.
Reply




corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.
Resource Listings