OR Statement??

  • Thread starter Thread starter B-Dog
  • Start date Start date
B

B-Dog

This has to be really simple but I can't figure it out. I'm trying to check
to make sure the dataset in not null and a single character string doesn't
equal two characters. I want it to stop if it is null and stop if the
string doesn't equal i or or? If either one is true then run sub. What am
I doing wrong

If dr Is Nothing OrEsle inOut <> "i" Or "o" Then

'bad filename

lstEvents.Items.RemoveAt(0)

Exit Do

End If
 
Hi,

Try:

If ((dr Is Nothing) OrEsle ((inOut <> "i") AND (inOut <> "o"))) Then

Good luck! Ken.
 
Shouldn't that read:

If ((dr Is Nothing) OrElse ((inOut <> "i") AndAlso (inOut <> "o"))) Then

Just to be optimal..

Thanks,
Shawn
 
Worked but I will try you way also. Thanks

Shawn B. said:
Shouldn't that read:

If ((dr Is Nothing) OrElse ((inOut <> "i") AndAlso (inOut <> "o"))) Then

Just to be optimal..

Thanks,
Shawn
 

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

Back
Top