Computing.Net > Forums > Programming > VB text change

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VB text change

Reply to Message Icon

Name: dambrose
Date: April 10, 2004 at 07:00:27 Pacific
OS: Windows 2000
CPU/Ram: NA
Comment:

I have a program I am working on. The program has a text box that accepts account numbers when a card is swiped. What I want to do is when a person swipes the card it searches a database for that account. The acoount is a 10 digit number. I tried to set up a event when the text is changed, but what happens is as soon as the card is swiped it recogonizes the first number then searches the database for the first number. Is there a way that I can have the text box want until the whole account number is entered.



Sponsored Link
Ads by Google

Response Number 1
Name: SN
Date: April 10, 2004 at 09:07:11 Pacific
Reply:

You could do it a couple of ways. You could wait until the textbox loses focus (probably not that great of an idea), or you could just slightly modify the routine you've already written to first check the length of the textbox, and if it's equal to 10, look up the record in the db.

if len(txtAccountNumber.text) = 10 then
'look up data in a database
end if

I've only been doing VB for about a week (I got a new job and they exclusively use VB and ASP.) so I'm a little shaky on the syntax but you get the general idea.

-SN


0

Response Number 2
Name: Infinite Recursion
Date: April 11, 2004 at 12:32:15 Pacific
Reply:

SN's approach to your problem is probably your best bet. Wait until the text reaches full length then process the DB search routine.


"I got a new job and they exclusively use VB and ASP."

Ahhhhhhhhhhhhhh! You can always throw system calls to your Perl scripts :)

I did that from PL/SQL via Java to my C++ programs when I first started working for my current employer... (there were really no standards in place though). They were primarily developing in PL/SQL, Javascript, and C.

I introduced PHP, C++, Perl, and Java into the applications that we were writing... so
now they don't have a choice but to support it until the end of the application's life cycle at least. :)

I have a library that I wrote with useful C++ functions, if I can't rewrite it in the language being used, then I drop to a system call and use the C++ functions. lol


IR


0

Response Number 3
Name: SN
Date: April 11, 2004 at 13:04:04 Pacific
Reply:

Yeah I'm sure they would love that...I'll sneak into the server room at night and install activeperl and php :-)

I can already feel the bad coding habits seeping into my bones...Microsoft technology is coder cancer!!! :-)

-SN


0

Response Number 4
Name: dambrose
Date: April 13, 2004 at 05:10:35 Pacific
Reply:

Thanks for all your help. I used SN solution and it worked perfectly.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


C++..HELP me with charact... mysql and PHP problem



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VB text change

VB text files www.computing.net/answers/programming/vb-text-files/8304.html

Simple VB text file query? Help! www.computing.net/answers/programming/simple-vb-text-file-query-help/14383.html

vb text boxes www.computing.net/answers/programming/vb-text-boxes/12194.html