Filtering through multiple combo boxes

Hello All

Thanks for the reply Martin

I did use the value of the combo box directly and was able to achieve what I wanted to.

Now I am trying something different, suppose I want to search >8 && <23 (from all the 4 combo boxes)

I have 4 combo boxes which are as follows:

combo box 1 - select a criteria (>, <,>=, <=) combo box 2 - Hours (1-100)

combo box 3 - select a criteria (>, <,>=, <=) combo box 4 - Hours (1-100) Search Button

Following methods I tried

Method #1 (click on Search Button after selecting all the necessary combo boxes)

void clicked()

{

FIMMSummarizationTable summaryTable; str summaryProjId; str qrySummaryProjId;

string255 criteriaCombo1;

string255 criteriaCombo2;

int hoursTxt1, hoursTxt2;

Query query; QueryRun queryRun;

hoursTxt1 = str2int(FIMMHours1ComboBox.valueStr());

hoursTxt2 = str2int(FIMMHours2ComboBox.valueStr());

while select * from summaryTable

where summaryTable.FIMMCourseProjId like projId + ‘*’ &&

summaryTable.FIMMWeeklyHours > hoursTxt1 &&

summaryTable.FIMMWeeklyHours < hoursTxt2

{

summaryProjId += summaryTable.FIMMCourseProjId + ‘,’;

}

qrysummaryProjId = subStr(summaryProjId,1,strLen(summaryProjId)-1);

qbr2.value(qrysummaryProjId);

super();

}

init for method 1

qbr2 = this.query().dataSourceName(‘FIMMSummarizationTable’).addRange(fieldNum(FIMMSummarizationTable,FIMMWeeklyHours));

Method # 2

void clicked()

{

hoursTxt1 = str2int(FIMMHours1ComboBox.valueStr());

hoursTxt2 = str2int(FIMMHours2ComboBox.valueStr());

qbr2.value(strFmt(’((%1 > %2) && ((%1 < %3)))’,

fieldStr(FIMMSummarizationTable,FIMMWeeklyHours),

any2int(hoursTxt1),

any2int(hoursTxt2)));

super();

}

init for method 2

qbr2 = FIMMSummarizationTable_ds.query().dataSourceName(‘FIMMSummarizationTable’).addRange(fieldNum(FIMMSummarizationTable,FIMMWeeklyHours));

Please advice

Thanks,

Shankar Iyer

as per my assumption…

Take stringEdit control instead of Combobox and

  1. in each modified lmethod of stringControl

qbr.value(strfmt(" > %1 ",this.valueStr()));

Table1_ds.executeQuery();

Table1_ds.research();

Or

2)in the clicked method as you said

qbr.value(queryRange(StringEditControl1.valueStr(), StringEditControl2.valueStr()));

Table1_ds.executeQuery();

Table1_ds.research();

please let me know if I’m wrong…

This thread has already 22 posts and I still don’t understand what’s the problem, I just see a lot of bad code. Nevertheless, it’s already marked as answered and if you want “to try something different”, please create a new thread.

I just didn’t get why you guys call research() when you just called executeQuery(). Do you think that the second execution will bring better data then the first one?

Thanks for the reply Martin.

I think I am trying different things in a same thread and that why it is creating confusion in everyone’s minds.

I will post my example again in a new thread so as to avoid confusion.

I just didn’t get why you guys call research() when you just called executeQuery(). Do you think that the second execution will bring better data then the first one?

Krishna had used in his example while replying to a post in this thread… that is the reason I included it in my code…

Thank you all for replying to this thread

Regards,

Shankar Iyer