Efficiency Issues & Select Case

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I have four conditions that are used every time a screen is opened, to
determine a) what language the screen shall display in and b) what features
are enabled

1) English & Area
2) English & District
3) French & Area
4) French & District

Currently, I am using an if statement to determine what needs to be
displayed. Is there a more efficient way, such as a select case? if a
select case statement is needed, how would it be set up?

Any ideas would be greatly appreciated
 
Hi all,

I have four conditions that are used every time a screen is opened, to
determine a) what language the screen shall display in and b) what features
are enabled

1) English & Area
2) English & District
3) French & Area
4) French & District

Currently, I am using an if statement to determine what needs to be
displayed. Is there a more efficient way, such as a select case? if a
select case statement is needed, how would it be set up?

Any ideas would be greatly appreciated

you probably don't even need a SELECT CASE... (although they're handy
because they're easy to read and expand, unlike an IF statement)...

IF Language="French" then
If SomeVariable="District" then
'do something
end if
ElseIf Language="english" then
If SomeVariable="District" then
'do something
end if
end if

or you could use a case statement..

SELECT CASE True
CASE Language="French" AND SomeVariable="District"
'do something
CASE Language="French" AND SomeVariable="NOT District"
'do something
CASE Language="English" AND SomeVariable="District"
'do something
CASE Language="English" AND SomeVariable="NOT District"
'do something
END SELECT

see the help in VBA... look up "SELECT CASE"
 
Back
Top