Results 1 to 5 of 5

Thread: 2 Quick Questions

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Posts
    6

    2 Quick Questions

    Ok I have an Input box which opens when I open the program and asks for the low number (between 0-30) how do I get it to keep asking me for the number until it's correct?


    And

    How do I get something I type in a text box to match with something I've loaded from a text file to match, when upper case and lower case in involved?

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    VB Code:
    1. Dim abc As Integer
    2.  
    3. Do While Not (abc >= 1 And abc <= 30)
    4. abc = CInt(InputBox("Enter a num betwen 1 and 30", "Enter!", 30))
    5. Loop

  3. #3
    Fanatic Member
    Join Date
    Sep 2000
    Posts
    770
    For the second question to you do:
    Code:
        If Instr(1, strData, Text1.Text,vbTextCompare+vbDatabaseCompare) <> 0 Then
            Msgbox "Found first occurance of '" & Text1.Text & "'"
        Else
            Msgbox "Not Found"
        End If
        
        '-strData is the string you are searching, text1.text is the search phrase you are
        '---searching with. This will only find the first
        '---occurance of a string in strData

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: 2 Quick Questions

    Originally posted by SychoBc


    How do I get something I type in a text box to match with something I've loaded from a text file to match, when upper case and lower case in involved?
    I didn't understand this clearly, but you would do something like this to compare:


    if lcase(text1.text) = lcase(varloadedfromfile) then
    'something
    end if

  5. #5
    Fanatic Member
    Join Date
    Sep 2000
    Posts
    770
    You might also want to try this function that I wrote for someone yesterday.

    http://www.vbforums.com/showthread.p...hreadid=271252

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