#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2008
    Posts
    3
    Rep Power
    0

    Filtering records for dbgrid


    Hi all
    I am busy writing my first delphi app for a friend, and I have got most of it to work.
    A quick rundown of the app is that they enter clients for short term insurance, and then each policy is then linked to each client. I have used the clients id number as the primary key on the clients table, and the client id as a foreign key on the portfolio table.
    My only problem is that I would like to display a list of the policies that each client has.
    I have a dblookuplistbox on the left that lists all the clients and then I have a group box that displays all of the clients details as a client is selected.
    I can't seem to get the policies to list for the specific clients that the user selects.
    I was looking at using a dbedit but how would I tell it to only display the policies for that specific client. At present it lists all the policies for all clients.

    Any help will be appreciated
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2005
    Location
    Northen England
    Posts
    52
    Rep Power
    45

    Filtering records for dbgrid


    It sounds like it might be of use for you to try the seting a filter on the table.

    s_id := 'username_id = "BOBBIE" ';
    tb_users.DisableControls;
    tb_users.Filtered := False;
    tb_users.Filter := '';
    tb_users.Filter := s_id;
    tb_users.Filtered := True;
    tb_users.EnableControls;
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2008
    Posts
    3
    Rep Power
    0
    I have set up a dblookuplistbox to select the clients. I would like to be able to filter the table using the info from the dblookuplistbox.
    I am very new to delphi I have a couple of books that I am working through. I have done development in php so I am not a programming newbie.
    Where will I set the code that you explained above

    Thanks
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2005
    Location
    Northen England
    Posts
    52
    Rep Power
    45

    Filtering records for dbgrid


    It sounds like it might be of use for you to try the seting a filter on the table.

    rocedure TForm2.DBLookupListBox1DblClick(Sender: TObject);
    begin

    /// Where AdsTable1 is the table you
    /// are looking up on .
    s_id := AdsTable1.fieldbyname('username_id').Text ;

    tb_users.DisableControls;
    tb_users.Filtered := False;
    tb_users.Filter := '';
    tb_users.Filter := s_id;
    tb_users.Filtered := True;
    tb_users.EnableControls;
    end;
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2008
    Posts
    3
    Rep Power
    0

    Deploying app


    I finished the app now I would like to create a setup file. I am using inno setup. I added my exe, libmysql.dll, and dbxmys30.dll.
    I have developed using dbexpress to like to my mysql database.
    When I install on a machine thjat has no delphi installed it starts up and then says that it has encountered a problem.
    Do I need to add any other files to my installation package
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2005
    Location
    Northen England
    Posts
    52
    Rep Power
    45

    Filtering records for dbgrid


    Originally Posted by lional
    I finished the app now I would like to create a setup file. I am using inno setup. I added my exe, libmysql.dll, and dbxmys30.dll.
    I have developed using dbexpress to like to my mysql database.
    When I install on a machine thjat has no delphi installed it starts up and then says that it has encountered a problem.
    Do I need to add any other files to my installation package
    Start another thread then your question will be seen by all users.

IMN logo majestic logo threadwatch logo seochat tools logo