I have a form for entering a person's address information and it has a few required fields that I check in a VBA function behind a command button.
If a required field is not completed, I send a message then SetFocus to the control.
The problem is no matter what control I SetFocus to in the function, Access says it "can't move the focus to the control".
The function is in a class module and is declared as Private. I have also attempted Public with the same dismal results.
I have no problem setting focus to the controls from another control. Thus I am thinking that the action coming from within the function has a bearing on the problem.
I could supply code but as you know, that is very straightforward. Have any of you encountered this problem and can you advise me as how to resolve it?
If a required field is not completed, I send a message then SetFocus to the control.
The problem is no matter what control I SetFocus to in the function, Access says it "can't move the focus to the control".
The function is in a class module and is declared as Private. I have also attempted Public with the same dismal results.
I have no problem setting focus to the controls from another control. Thus I am thinking that the action coming from within the function has a bearing on the problem.
I could supply code but as you know, that is very straightforward. Have any of you encountered this problem and can you advise me as how to resolve it?