|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Error Checking and SetFocus
When a user makes a choice from ListBox1, I populate ListBox2 (unbounded) based on the value of ListBox1, and set the focus to the first line "-----", forcing the User to make a choice.
On ListBox2 I use the LostFocus() event to check whether the user made a choice other than "-----". If the value is still "-----" I display a message and set the focus back to ListBox2. Problem - the focus doesn't go to ListBox2 the second time, but moves to the next control. I tried moving the Error Checking to the Form_BeforeUpdate event, and it works on the first pass, but if the User attempts to Save the record a second time without making a choice, Access goes ahead and moves to the next record. Suggestions? Thanks, Charlie |
|
#2
|
|||
|
|||
|
One option, disable the subsequent fields by default and enable only after a valid selection has been made.
__________________
El éxito consiste en una serie de pequeñas victorias día a día MySQL, MS SQL, MS ACCESS, Oracle Database Manager - http://victorpendleton.net/products/psdviewer.html |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Error Checking and SetFocus |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|