Al Smith
Jan 25th, 2000, 07:11 AM
Hi,
I'm trying to use the LostFocus on a couple of text boxes to auto-populate some other text boxes. Everything works ok as long as valid data is entered. But I'm trying to trap invalid input. Here's the gist of the program.
Text1 "Enter Warehouse Code".
When Text1 loses focus Text2, the warehouse name, is populated from a database.
Text3 "Enter Part Number"
When Text3 loses focus Text4, the part description, is populated from a database.
The problem is if an invalid warehouse code is entered. If the warehouse code doesn't exist in the database a message box pops up stating "Warehouse Code XXXXX Invalid". But the focus has moved to Text3 via the [TAB] key. When you back-tab to Text1 to correct the warehouse code, Text3 loses focus and tries to find a blank part number in the database. A message box pops up stating "Part Number Invalid".
Question 1: Can I make a losefocus event happen except if something else happens?
Question 2: Is there a better way of doing what I'm trying to 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>
I'm trying to use the LostFocus on a couple of text boxes to auto-populate some other text boxes. Everything works ok as long as valid data is entered. But I'm trying to trap invalid input. Here's the gist of the program.
Text1 "Enter Warehouse Code".
When Text1 loses focus Text2, the warehouse name, is populated from a database.
Text3 "Enter Part Number"
When Text3 loses focus Text4, the part description, is populated from a database.
The problem is if an invalid warehouse code is entered. If the warehouse code doesn't exist in the database a message box pops up stating "Warehouse Code XXXXX Invalid". But the focus has moved to Text3 via the [TAB] key. When you back-tab to Text1 to correct the warehouse code, Text3 loses focus and tries to find a blank part number in the database. A message box pops up stating "Part Number Invalid".
Question 1: Can I make a losefocus event happen except if something else happens?
Question 2: Is there a better way of doing what I'm trying to 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>