Moving focus to another control

klwu

Brainy!!
Local time
Today, 13:47
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
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.
 
Never mind, I have solved the problem...I forgot to set the cmbStockCode to enable....:o
 

Users who are viewing this thread

Back
Top Bottom