Results 1 to 3 of 3

Thread: [RESOLVED] Quick Question

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    2

    Resolved [RESOLVED] Quick Question

    When creating an If...Then statement, how do I make more than one if?

    For example

    If TextBox5.Text = "1" OR "2" Then
    Do something
    End If

    I need to make it so it will work if the textbox has 1 or 2. For right now, I can only get it for one number, or I will get an error that says the number 2 cannot be converted to boolean.

    Thanks for your help.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Quick Question

    if textbox5.text = "1" or textbox5.text="2" then...

    Or

    if textbox5.text = "1" orelse textbox5.text="2" then...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    2

    Re: Quick Question

    Thank you so much. This is just what I needed.

    I'm new to this...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width