Question : Switching Focus from one Form Control to another in Access

When running the block of code below, I get an error message (see attached screen shot). Does anyone have a possible work around for this?  Thanks!

1:
2:
3:
4:
Private Sub txtCode_KeyPress(KeyAscii As Integer)
MsgBox "Click Update Command Button to execute changes.", vbExclamation + vbOKOnly, "Field Restriction"
Me.cmdUpdateCode.SetFocus
End Sub


Attachments:
 
Screen shot
Screen shot
 

Answer : Switching Focus from one Form Control to another in Access

there must be some conditions preventing the codes.

check if any of the follwing is true

* The control may be a type that can't receive the focus, such as a label.
* The control's Visible property may be set to No.
* The control's Enabled property may be set to
Random Solutions  
 
programming4us programming4us