Click to See Complete Forum and Search --> : Setting focus back on a field (right version!)


fhaldimann
September 24th, 1999, 09:13 AM
In my UserForm the date input is made of 3 fields (TextBox): one for the day (MaxLength-Property=2), one for the month (MaxLength=2) and one for the year (MaxLength=4). When entering the fourth digit in the year field an Exit-Event is started which composes the date with the entered day's and month's digits. A date validation is then executed (in then Exit-Event/Function) and i would like the focus to be set back in then day-field if the composed date is not valid (with the setfocus-Method use in the year-field Exit-Event). But I can't!
The focus doesn't stay in the day-field, it leaves it and jumps forward two field afer the year-field.
I don't know exactly which VB-version I'm using,
it's the one integrated in MS-Excel 97.