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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Idea for efficent solution, pls ...

Status
Not open for further replies.

pgferro

Programmer
Aug 21, 2001
111
BS
Hi Guys,

I have this situation :

Period1 (mandatory)
Period2 (optional)
Period1Available (T/F)
Period2Available (T/F)

I would like to display in a form :

1. No periods available
2. Period1 and Period2 in a select if both exists and are available
3. Period1 if Period1 is available and Period2 either is empty or not available
4. Period2 if Period2 is available and Period1 is not

Any idea for a solution without 100 if/endif ??

THANKS!

--
PG
 
Select case?


[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Would you pls elaborate a select case with those conditions ?

Thanks

--
PG
 
sounds like you need 4 cases (whatever the syntax)

caseID = 10*Period1Available + Period2Available

if caseID = 0 then
none available
elseif caseID = 11 then
select box
elseif caseID = 10 then
Period1
else
Period2
end if

You could, of course, re-write this as a select statement.
 
This
[blue]Period1 (mandatory)[/blue]
Period2 (optional)
Period1Available (T/F)
Period2Available (T/F)
Does not sync with these:
1. [blue]No periods available[/blue]
2. Period1 and Period2 in a select if both exists and are available
3. Period1 if Period1 is available and Period2 either is empty or not available
4. [blue]Period2 if Period2 is available and Period1 is not[/blue]

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Tom,

Period1 = "From April 1 to April 23"
Period1Available = "TRUE" or "FALSE"

So Period1 must exist but may not be available

--
PG
 
Of course, mine assumes that true can be converted to 1 and false to 0.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top