i have a textbox IssueDate for date field.
it is enabled=true, visible=true, locked=false, Tab Index=0, Tab Stop=Yes
when i run below code, it gets error 2110, cannot move focus to that control
Thanks.Code:Me.IssueDate.SetFocus
i have a textbox IssueDate for date field.
it is enabled=true, visible=true, locked=false, Tab Index=0, Tab Stop=Yes
when i run below code, it gets error 2110, cannot move focus to that control
Thanks.Code:Me.IssueDate.SetFocus
Do you have any code that changes those property settings, perhaps in the forms Load or Open events?
Which event is your SetFocus code in?
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
No code to change this control property.
This SetFocus action is in Form_Open.
When in debug mode, it shows the 2110 error and stop on Me.IssueDate.SetFocus line.
But when I press F8, it can pass through and run the rest of coding.
A - I presume the control is either unbound or bind to a editable field?
B - what is the tab Order for the control- if it is the first one it already has the focus so setting it again can cause an error
C - the form open event is probably too soon to be setting focus as the controls have not yet been populated - try the current event
Thanks Ajax.
I put the code to Form_Current, then it works.
I also test to set the Tab Order to value other than 0, it will also receive 2110 error.