|
-
Jul 28th, 2000, 01:07 PM
#1
Thread Starter
Frenzied Member
I have a text box, and I want the user to enter any thing into a text box, and then click ok, then my program searches the text box for the number 123, if it find it then a message box comes up saying that it found it, if not, then a message box comes up saying that it didn't find the number in it
I hope that was clear
thanks in advance
dimava
NXSupport - Your one-stop source for computer help
-
Jul 28th, 2000, 01:24 PM
#2
Fanatic Member
Code:
If InStr(1, Text1.Text, "123") Then
MsgBox("123 Found"), , "String Match"
Else:
retval = MsgBox("123 Not Found"), vbExclamation Or vbOkOnly, "String Not Found"
End If
I hope this is what you were looking for,
Me
[Edited by V(ery) Basic on 07-28-2000 at 02:26 PM]
-
Jul 28th, 2000, 01:26 PM
#3
Thread Starter
Frenzied Member
NXSupport - Your one-stop source for computer help
-
Jul 28th, 2000, 01:30 PM
#4
Thread Starter
Frenzied Member
I tried it and a error message comes up
the 2 lines that that say message box come up in red
NXSupport - Your one-stop source for computer help
-
Jul 28th, 2000, 01:35 PM
#5
Lively Member
Make them look like this:
If InStr(1, Text1.Text, "123") Then
MsgBox "123 Found", , "String Match"
Else
retval = MsgBox("123 Not Found", vbExclamation Or vbOKOnly, "String Not Found")
End If
-
Jul 28th, 2000, 01:37 PM
#6
transcendental analytic
You could use Like operator, it's definitely faster
Code:
If Text1.Text Like "*123*" Then...
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 28th, 2000, 03:10 PM
#7
Thread Starter
Frenzied Member
ok, thanks to all for your help
NXSupport - Your one-stop source for computer help
-
Jul 28th, 2000, 03:42 PM
#8
Thread Starter
Frenzied Member
one more question....
I ahev it search for "AbC*"
I need the * to be a single digit number
now what if the * is not a number, its a letter
is there a way to make it so that if the * isn't a number then it clears text1.text?
I hope I was clear, if not I can try to re-explain myself
NXSupport - Your one-stop source for computer help
-
Jul 28th, 2000, 04:01 PM
#9
Lively Member
Use The # character instead of *.
-
Jul 28th, 2000, 04:08 PM
#10
_______
<?>
Dim x As String
x = Right(Text1, 4)
If Asc(x) < 80 Or Asc(x) > 89 Then
MsgBox "no number"
End If
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
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
|