klwu
Brainy!!
- Local time
- Today, 19:19
- Joined
- Sep 13, 2004
- Messages
- 47
Hi, I am stuck at a point where I want to set the focus to another control when a control has been clicked.
e.g. I have a command button (cmdAccept), when this button has been clicked, I want to disable this control, and move the focus to a combo box (cmbStockCode). How should I achieve this? I have tried to put in codes in the event procedure of cmdAccept.OnClick event, but I get a error saying that "Microsoft Access cannot move the focus to cmbStockCode."
here is my code
Could someone help me on this? Thanks in advance.
e.g. I have a command button (cmdAccept), when this button has been clicked, I want to disable this control, and move the focus to a combo box (cmbStockCode). How should I achieve this? I have tried to put in codes in the event procedure of cmdAccept.OnClick event, but I get a error saying that "Microsoft Access cannot move the focus to cmbStockCode."
here is my code
Code:
Private Sub cmdAccept_Click()
On Error GoTo Exit_cmdAccept_Click
Me!cmbStockCode.SetFocus
Me!cmdAccept.Enabled = False
Exit_cmdAccept_Click:
Exit Sub
Err_cmdAccept_Click:
MsgBox Err.Description
Resume Exit_cmdAccept_Click
Could someone help me on this? Thanks in advance.