|
-
Dec 11th, 2003, 01:41 AM
#1
Thread Starter
New Member
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?
-
Dec 11th, 2003, 01:46 AM
#2
VB Code:
Dim abc As Integer
Do While Not (abc >= 1 And abc <= 30)
abc = CInt(InputBox("Enter a num betwen 1 and 30", "Enter!", 30))
Loop
-
Dec 11th, 2003, 01:47 AM
#3
Fanatic Member
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
-
Dec 11th, 2003, 01:48 AM
#4
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
-
Dec 11th, 2003, 01:56 AM
#5
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|