Efficiency Issues & Select Case

C

Carlee

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
 
P

pietlinden

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top