1 (edited by eyeman303 2022-05-16 19:16:14)

Topic: Combobox-incremental search

Hello,
I am trying to update a mutual fund database program. I just want that the tablegrid7 in LU_Form_012_MF_Invested display the Rating of fund when Combobox1 changes. This will give the investor a better idea of the fund being invested. This form saves the combobox1 data to the table AA_012_FundsInvested. The search button28 searches table AA_014_MF_Rating. If the search component is combobox1, it returns all records,while if it is combobox2 (foreign key AA_014_MF_Rating.id_LU_003_FUND_SELECT), it works ok. However I do not want to again select fund in combobox2, to get the search result. How can I get search result automatically from combobox1 change? Please see the attachment.
Regards,
Eyeman

Post's attachments

Attachment icon COMBOBOX_SEARCH.zip 884.03 kb, 130 downloads since 2022-05-16 

Re: Combobox-incremental search

Hello,
Please have a look at the attached project file.
Regards,
Eyeman

Post's attachments

Attachment icon MutualTracker17.zip 402.84 kb, 127 downloads since 2022-05-17 

3 (edited by sparrow 2022-05-17 09:25:38)

Re: Combobox-incremental search

Hi eyeman,


What you are asking for help at the moment looks like a quest game "Leisure Suit Larry".
Go and seek.
1. Try to find a form! Long searched, found.
2. Fill in the fields yourself to get to the form! Filled out.
3. Launched the form.
4. ??? And everything is empty. The database is not filled with any test data???

If you need help, make it so that help can be provided.
Thank you.
Value your time and the time of others.

Re: Combobox-incremental search

Hello Sparrow,
Sorry for the unintended inconvenience. Database file is little big and I am unable to post the same. I have uploaded it at Dropbox.
https://www.dropbox.com/s/7wy65fxaynnuk … 8.zip?dl=0 Please have a look.
Regards,
Eyeman

5 (edited by sparrow 2022-05-17 17:40:09)

Re: Combobox-incremental search

If I understand you correctly, do you need combo2 to change after the combo1 with same value and the search?
Please try change script like this

procedure  LU_Form_012_MF_Invested_combobox1_onchange (Sender: TObject; var Cancel: boolean);
begin
     LU_Form_012_MF_Invested.combobox2.dbItemID :=  LU_Form_012_MF_Invested.combobox1.dbItemID;
     LU_Form_012_MF_Invested.Button28.Click;
end;

Re: Combobox-incremental search

Hello Sparrow,
Your solution is spot-on! This was exactly what I was trying to achieve. The table-grid now displays the current rating of the fund invested.
Thanks a lot.
Regards,
Eyeman