I have a table-linked form I've created in VB 6. Here's what I'm trying to do. We have:
Field 1
Field 2
Field 3
Here is the desired behavior. Upon form activation, focus goes to field 2. A value is entered. If this value matches one of a list of values, that value is entered in field 1, and I need field 2 to be blanked out and focus to remain on field 2. If the value entered in field 2 is not in the list, the value should be entered in field 2 and focus should go to field 3.
Currently, if I enter a value which is in the list in field 2, it properly populates field 1 with that value, but the cursor then moves to field 3, following the default tab order. What I tried to do was to include "Field2.setfocus" in the Change procedure for field 1, so that when a value from the list was entered in field 2, it would be placed in field 1 and focus would return to field 2.
That didn't work. Neither did placing "Field2.setfocus" in the LostFocus procedure of Field 1, which didn't work either. In fact, the SetFocus command doesn't seem to be having any affect at all. What other options are there?
Field 1
Field 2
Field 3
Here is the desired behavior. Upon form activation, focus goes to field 2. A value is entered. If this value matches one of a list of values, that value is entered in field 1, and I need field 2 to be blanked out and focus to remain on field 2. If the value entered in field 2 is not in the list, the value should be entered in field 2 and focus should go to field 3.
Currently, if I enter a value which is in the list in field 2, it properly populates field 1 with that value, but the cursor then moves to field 3, following the default tab order. What I tried to do was to include "Field2.setfocus" in the Change procedure for field 1, so that when a value from the list was entered in field 2, it would be placed in field 1 and focus would return to field 2.
That didn't work. Neither did placing "Field2.setfocus" in the LostFocus procedure of Field 1, which didn't work either. In fact, the SetFocus command doesn't seem to be having any affect at all. What other options are there?