Hi guys,

After figuring out the update data to listview in another post, I have this problem with my textbox

I have a textbox that allows the user to enter a certain number, when that textbox has lostfocus(as i have currently set) it will check the database and retrieve the data for that number i entered in the first textbox and so forth. The problem I am having is when that textbox is empty and i click anywhere else on the form it activates that lostfocus event for that textbox.
I got it partially solved by changing the textbox event so when i press ENTER key it will do that accessing database and so forth, however I can't get it working with the TAB key as it won't recognise the ascii kode for TAB key.

any help guys ?

Use keycode instead of Ascii. Handles KeyDown event.

if e.KeyCode==Keys.Tab Then
 ....
End if

Use keycode instead of Ascii. Handles KeyDown event.

if e.KeyCode==Keys.Tab Then
 ....
End if

hmmm expression expected?

I have put == double euqal sign. Please us single equal sign.

if e.KeyCode=Keys.Tab Then
 ....
End if

Actually got it to work with ur code
with textbox set to multiline and form property to accept tab = true
thanks

actually have the problem with using that code, it now puts a tab space in front of the data in the textbox, so when it inserts it into the database, theres a space or something there which screws up all my code with that space....
tried trim and replace "\s*" but still can't... any help guys ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.