Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8832291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:29:43+00:00 2026-06-14T08:29:43+00:00

I heard VB gets confused with multiple logical operators at once, so I’m stuck

  • 0

I heard VB gets confused with multiple logical operators at once, so I’m stuck here. I have 3 textboxes and I want to check if any of them is empty.

This simple If did not work:

If txt1.Text = "" Or txt2.Text = "" Or txt3.Text = "" Then -Something-

However it works if I only put two of them to compare.

Thanks for your answers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:29:44+00:00Added an answer on June 14, 2026 at 8:29 am

    The code above should work but check for null or empty string with
    String.IsNullOrEmpty is more elegant:

     If String.IsNullOrEmpty(txt1.Text) Or _
       String.IsNullOrEmpty(txt2.Text) Or _
       String.IsNullOrEmpty(txt3.Text) Then
            'Do something
        End If
    

    PD: If you use several “OR”, all the conditionals will be checked.

    If you use OrElse, it will check the conditionals in order and when one it’s not true
    the next conditional statements will not be checked

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a website and heard that if the website gets listed on
I have a device that connects to pc via USB, which gets mapped to
In .net, I have an inherited control: public CustomComboBox : ComboBox I simply want
I'm trying to write a scalable custom web server. Here's what I have so
So I've always heard and read that you need to sanitize any user input
I have heard a few people say that deploying a portlet war file (or
We have all heard that one should never rebase published work, that it’s dangerous,
I wanted to append css stylesheet inside head tag but gets appended to body
I heard that it's possible to identify the brand of a device (or at
I heard that having @foreach inside of a view is a no-no. Meaning, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.