i want to check for null entry in a combobox and display a msgbox when lostfocus and afterupdate events of the combobox and on_click event of the 'Add' control, are triggered.
This is my code for lostfocus:
Private Sub combo_LostFocus()
If IsNull([combo]) Then
If MsgBox("Is combo supposed to be Null?", vbYesNo) = vbYes Then
Me!combo = "-"
Else: Me!combo.SetFocus
Exit Sub
End If
End If
The problem is when i select 'yes' in the msgbox, Me!combo.SetFocus is not implemented, instead 'Add' control is set focus (by the way, 'Add' control is tabbed after combo in the predefined tab order).
How do i solve the problem?
End Sub
This is my code for lostfocus:
Private Sub combo_LostFocus()
If IsNull([combo]) Then
If MsgBox("Is combo supposed to be Null?", vbYesNo) = vbYes Then
Me!combo = "-"
Else: Me!combo.SetFocus
Exit Sub
End If
End If
The problem is when i select 'yes' in the msgbox, Me!combo.SetFocus is not implemented, instead 'Add' control is set focus (by the way, 'Add' control is tabbed after combo in the predefined tab order).
How do i solve the problem?
End Sub