PDA

Click to See Complete Forum and Search --> : Making a text box do something when exited?


Al Smith
Jan 24th, 2000, 08:18 AM
Hi,
How do make a text box run a program when that text box is exited with a tab or mouse click?

For example:
Text1 = "Enter Part Number"
Text2 = "Enter Description"
Text3 = "Enter Quantity Received"

Text2 could be automatically populated from the database if the program looked at the database when Text1 is exited.

I don't need to know how to grab data from the database. This I can do.

Thanks,
Al.


------------------
A computer is a tool, not a toy.
<A HREF="mailto:asmith3914@aol.com
asmith@spxateg.com">asmith3914@aol.com
asmith@spxateg.com</A>

chrisjk
Jan 24th, 2000, 08:30 AM
Put your code in the LostFocus event of the text box. It gets fired if the user uses the mouse to click something else, and if TAB is used, infact any method of moving focus to something else will fire the event.

Regards,

[This message has been edited by chrisjk (edited 01-24-2000).]

Al Smith
Jan 24th, 2000, 09:30 AM
Ok?
I know of GotFocus and LostFocus but I don't know how to use them. My text boxes default to Text1_Change().

I tried:
If Text1.LostFocus = True then... but, probably obvious to you, this didn't work.

How does one use GotFocus or LostFocus?

Thanks,
Al.



------------------
A computer is a tool, not a toy.
<A HREF="mailto:asmith3914@aol.com
asmith@spxateg.com">asmith3914@aol.com
asmith@spxateg.com</A>

X_Darknight_X
Jan 24th, 2000, 11:57 AM
Each of those are event procedures....like Text1_Change

Just switch to that event and place your code in there.

------------------
David Underwood
Cannabatech Corporation

ICQ - 14028049 (http://www.icq.com/14028049)
E-mail - darknight23@hotmail.com

DiGiTaIErRoR
Jan 24th, 2000, 01:15 PM
here:

Private Sub Text1_LostFocus()
text2.text = myDB
End Sub

Good luck,

------------------
DiGiTaIErRoR


[This message has been edited by DiGiTaIErRoR (edited 01-25-2000).]