Really simple Question.

  • Thread starter Graham Mattingley
  • Start date
G

Graham Mattingley

I think I have lost my brain, or drank too much Redbull, because I cant make
the following work.


if menu_list <> "age" OR menu_list <> "first_name" then
....
else
.......
end if

If I do this below, it works.

if menu_list <> "age" then
....
else
.......
end if

How do I this with more than one option, is it with ELSE IF ??

Kind Regards

Graham Mattingley
 
T

Tom B

You'll never get to your else, because it will always match your expression
Example1: menu_list ="age" --- it doesn't equal "first_name" so it'll do
what's in the if
Example2: menu_list="first_name" --- it doesn't equal "age" so it'll do
what's in the if
Example3: menu_list="BOB" --- it doesn't equal either, so it'll do what's in
the if.

I assume you want to use an AND

if menu_list <> "age" AND menu_list<>"first_name" then
'Example 3 would end up here
else
'Example 1 and 2 would end up here
end if


OR

if menu_list="age" OR menu_list="first_name" then
'Example 1 and 2 would end up here
else
'Example 3 would end up here
end if
 
G

Graham Mattingley

Thanks Tom,

I knew it would be simpleish, think I have been at the screen to long today
:)

it is all working now :)

Graham Mattingley
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top