Results 1 to 4 of 4

Thread: [RESOLVED] Need help with code

  1. #1

    Thread Starter
    Lively Member Jamiex's Avatar
    Join Date
    Sep 2007
    Location
    Scotland, UK
    Posts
    116

    Resolved [RESOLVED] Need help with code

    Hi

    I am new to this forum so if im doing anything wrong just tell me.

    What my question is that i have this code

    Private Sub Command1_Click()
    If txtBox_value < 1 Then
    Form4.Hide
    Form6.Show

    Else
    Form4.Hide
    Form5.Show
    End If

    End Sub


    But i want it to be < 1 Or > 4 Then

    The thing is when i put in "Or" it comes up saying expected expression so im guessing its not "Or" or i have to add something else in. Could someone help me as its probably just a silly thing that i have forgot.

    Thanks

    Jamie

  2. #2
    Frenzied Member
    Join Date
    Sep 2006
    Location
    Scotland
    Posts
    1,054

    Re: Need help with code

    You have to do it like this:
    Code:
    If txtBox_value < 1 or txtBox_value > 4 Then

  3. #3

    Thread Starter
    Lively Member Jamiex's Avatar
    Join Date
    Sep 2007
    Location
    Scotland, UK
    Posts
    116

    Re: Need help with code

    Thanks

    I knew it would be something really simple that i had forgot

    Thanks Again

    Jamie

  4. #4
    Frenzied Member
    Join Date
    Sep 2006
    Location
    Scotland
    Posts
    1,054

    Re: Need help with code

    Now that everything has been sorted you can help us out by marking the thread 'Resolved'. Just in case your not sure how to do this go to thread tools and choose 'Mark Thread Resolved'.

    Thanks

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