Textbox IF statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nextbgates95
    New Member
    • Aug 2007
    • 2

    Textbox IF statement

    I need help taking the text from a text box and using that text in an IF statement. I'm a newbie.
  • JonJacobs
    New Member
    • Aug 2007
    • 22

    #2
    [CODE=vb]Public Sub DoSomethingStra nge(A as String)
    'Put whatever logic you need in here
    End Sub

    Dim Answer as string = Textbox1.Text
    If Answer="Do Something, Please!" then
    DoSomethingStra nge(Answer)
    End If[/CODE]

    HTH

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      I'm guessing that you mean you want to enter a condition in the textbox, such as "A = 4", and then use that as the test in an IF statement - correct?

      If so, I think it may be possible, using the Microsoft Scripting engine. Try some searches on that, I think it has been covered here before.

      Comment

      • sumitbatra1981
        New Member
        • Aug 2007
        • 4

        #4
        if textbox1.text=" " then
        msgbox.show "Please enter value"
        end if

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          Originally posted by sumitbatra1981
          if textbox1.text=" " then ...
          I think we need some feedback from nextbgates95 to clarify what the actual question is.

          Comment

          Working...