Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed regarding Combo Box!!!

Status
Not open for further replies.

AsiaK

IS-IT--Management
Oct 14, 2001
3
US
Hi to all!!
I’m quite new to developer 2000.
I need ur help regarding the combo boxes.
I want to create two combo boxes which should display the values obtained from other tables.
The first combo box should display the list of make (field name) from the table make and another should display a list of model from the table model. The make list is working fine but the model list isn’t. It should display only those models which are referring to that particular make (e,g if the make is Honda then it should display only Civic,City, etc). Instead, it is displaying all the models, which are stored in that table (model).

For this purpose I have created two record groups called make_rg and model_rg. Here is the query which I’m writing in the record group:

Make_rg:
Select make_nm, to_char(make_cd) from make order by make_nm
Model_rg:
select model_nm, to_char(model_cd) from model, make where make.make_cd = model.make_cd order by model_nm
I have also created a procedure which is being called in the new_form_instance trigger.

Am I doing it correctly? Am i referring the tables correctly?
What ever the problem is please help me out as soon as possible as I don’t have much time left.
Any help would be really appreciated.

Regards,
AsiaK
 
You have to repopulate the second group to hold only those records corresponding to the state of make combo. Now the query it's populated from has no such restriction. If your make combo is called MAKE you may create your second recordgroup from query

select model_nm, to_char(model_cd) from model, make where make.make_cd = :make order by model_nm

And populate it within when-list_changed of first combo.

 
Hi Sem,
Thanks for ur help but I'm still having the problem. I think i'm not populating the list correctly.
Please tell me in detail how to populate the list.
I did change the query as u told me too and also tried to populate the list through the trigger but there is no affect.
The following is the code which i'm writing in the when_list_changed trigger (combo box - make):
DECLARE
group_id RecordGroup := Find_Group('MAKE_RG');
list_id Item := Find_Item('MODEL.MAKE_CD');
group_id1 RecordGroup := Find_Group('MODEL_RG');
list_id1 Item := Find_Item('USED_CAR.MODEL_CD');
BEGIN
Retrieve_List(list_id, 'MAKE_RG');
Clear_List(list_id);
Populate_List(list_id1, 'MODEL_RG');
END;

I don't know whether it's correct or not. please tell me what is the problem. What should i do?
Thanx in advance,
AsiaK
 
You have to repopulate record group before populating list:

populate_group(group_id1)

if your MODEL_RG group is based on query, depending on the value of MODEL.MAKE_CD item.

If it was populated some other way, repopulate it in the same manner but with new data.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top