Question

Locked

ASP

By kmosli ·
I am basically writing a code, asp, connecting to an MS Access DB. The form basically has 10 inputs, drop-down menus. A user can select 1, or 2, or 3, or 4 and so on and so forth selection of the ten menus. So far I wrote a code in asp and sql that using if...statements for 4 of the menus. When I calculated how many I have to write !!!! I was shocked !! I think it is more than 800 different startements !!

My question is DO YOU KNOW any alternative to this solution!! The if statements for 800 is too very much !!

Thanks for your help

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Several options depending on what you are doing...

by cmiller5400 In reply to ASP

Select Case would be a start...

If you are using ASP.NET you have more options. I am not a web developer, but have knowledge of GUI programming. Depending on what you are doing there could be a zillion ways of doing it. More explanation of what you are trying to accomplish is required.

Collapse -

ASP, SQL

by kmosli In reply to Several options depending ...

I basically wrote a code in HTML and ASP to read from a MS Access DB. The dB has information about "scholarships for students which includes: name of scholarships, amount of funds, major, gender, ethnicity, GPA,...etc. My ASP page has ten drop-down menus: you are required to choose/select from these menus: major, gpa, gender, in order to narrow down the search as a student. The result of the search is all the scholarships that fit your criteria. Note that you have the option to either select from one drop-down menu or ten of them. In other words, if you select your major only, it will show you all the scholarships that are under this major regardless of the other factors. If you decide to narrow down your search and choose your major and gender for example, this will decrease the results and will be able to see all the scholarships that belong to your criteria. and so on and so forth.

Where I am standing: I tested it my code with only four drop-down menus and it works fine. When I have four drop-down menus, I will have 16 possibilities/scenarios. In other words, some students do not narrow their search and some do. Therefore, having 10 drop-down menus will end up having 1023 scenarios. In other words, I have my code based on If statements (if a student chooses major, and gender , but not the rest of the drop-down menus, then I will display certain things from the DB.

Thanks for your response and please advise if you need more explanations...

I appreciate your attentions...

Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums