IF and SELECT CASE commands

  • Thread starter Thread starter Angela
  • Start date Start date
A

Angela

Guest
I am a beginner but have managed to set up a database. I do not understand how apply the IF and SELECT CASE commands. Can anyone help?
 
"If" statements vice "Select Case" statements

Both are very usefull. "If this then this else that"

What I do as a rule to choose which of these to choose between is look at the criteria being used to determine what to do. (Other programmers may disagree with me, but what field of expertise have all experts agreeing all the time)

First if there are multiple criteria such as:

If Apples = Red and Leaves = Green, I will use an if statement:

Example:

If Apples = Red and Leaves = Green then
'Do something
ElseIf Apples = Gold and Leaves = Green then
'Do something Else
Else
'Do another thing
end if

For a select statement I will use it if I have a finite amount of possibilities:

Select Case Apples
Case Red: 'Do something
Case Gold: 'Do Something
Case Else: 'Do something
End select

hope this helps
 

Users who are viewing this thread

Back
Top Bottom