Filtering values from a TextBox?

Filtering values from a TextBox?

Anonymous
Not applicable
179 Views
3 Replies
Message 1 of 4

Filtering values from a TextBox?

Anonymous
Not applicable
Hi all.

 

How can I "search for" of "filter" a bit of text within a textbox but
ignore the rest. Example:

 

The user types in "A001" into the text box.  I want to write and IF
Then statement that says:

 

IF Textbox1.text = "A" Then

do things

 

The only problem is that the text box does not really = "A" it equals
"A001".  How do I filter this?

 

Thanx for any help.

 

Rob

 
0 Likes
180 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
If Left(Textbox1.Text, 1) = "A" Then

 

Joe


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Hi all.

 

How can I "search for" of "filter" a bit of text within a textbox but
ignore the rest. Example:

 

The user types in "A001" into the text box.  I want to write and IF
Then statement that says:

 

IF Textbox1.text = "A" Then

do things

 

The only problem is that the text box does not really = "A" it equals
"A001".  How do I filter this?

 

Thanx for any help.

 

Rob

 
0 Likes
Message 3 of 4

Anonymous
Not applicable
If you only need to respond to the text when it *starts* with A, try something
like this:

If TextBox1.Value Like "A*" Then

End If

If an "A" anywhere in the text requires a response:

If Instr(TextBox1.Value, "A") Then

End If

Both examples are case sensitive but you can use LCase, UCase or, in the case of
Instr, an optional parameter to get around it.

--
http://www.acadx.com
Win a free autographed copy of
"AutoCAD 2000 VBA Programmer's Reference"

"Rob Outman" wrote in message
news:E2D82BEE68EF13150883647F7134D5E2@in.WebX.maYIadrTaRb...
> Hi all.
>
> How can I "search for" of "filter" a bit of text within a textbox but ignore
the rest.
0 Likes
Message 4 of 4

Anonymous
Not applicable
Thanx Everyone. All of the examples work great.

Rob

"Frank Oquendo" wrote in message
news:1BEDF2CAF7409DE617899F98E6018800@in.WebX.maYIadrTaRb...
> If you only need to respond to the text when it *starts* with A, try
something
> like this:
>
> If TextBox1.Value Like "A*" Then
>
> End If
>
> If an "A" anywhere in the text requires a response:
>
> If Instr(TextBox1.Value, "A") Then
>
> End If
>
> Both examples are case sensitive but you can use LCase, UCase or, in the
case of
> Instr, an optional parameter to get around it.
>
> --
> http://www.acadx.com
> Win a free autographed copy of
> "AutoCAD 2000 VBA Programmer's Reference"
>
> "Rob Outman" wrote in message
> news:E2D82BEE68EF13150883647F7134D5E2@in.WebX.maYIadrTaRb...
> > Hi all.
> >
> > How can I "search for" of "filter" a bit of text within a textbox but
ignore
> the rest.
>
>
0 Likes