Answered by:
When closing the Form I get Err number 2110

Question
-
Hello,
I have an Access app that has Radiobuttons. When I try to close the app using X button I get:
Run-time error "2110":
Can't move focus to the control FrameOptions.
Whether I click the "End" or "Debug" buttons on error messagebox, the application closes and I am unable to find out which line is causing the app to produce this error.
What is the correct syntax to close the form without seeing this error message?
Any help or suggestion is appreciated.
Savalan
Thursday, July 26, 2018 2:27 PM
Answers
-
So, if you comment out the SetFocus part, does the error go away when you close the form?
- Marked as answer by Savalan Thursday, July 26, 2018 3:30 PM
Thursday, July 26, 2018 3:20 PM
All replies
-
Hi,
Do a search in your form's module and look for something like "SetFocus" or "GoToControl" and show us what you find.
Hope it helps...
Thursday, July 26, 2018 2:46 PM -
Hi DBgun,
Thank you for the reply. The only place app sets focus to option buttons is in a sub I created and I call this sub from inside form load event.
Private Sub OptionFocus() With Me.FrameOptions .Value = Me.optDate.OptionValue .SetFocus End With End Sub
Private Sub Form_Load()
OptionFocus
End SubRegards,
Savalan
Thursday, July 26, 2018 3:12 PM -
So, if you comment out the SetFocus part, does the error go away when you close the form?
- Marked as answer by Savalan Thursday, July 26, 2018 3:30 PM
Thursday, July 26, 2018 3:20 PM -
Yes. It does.Thursday, July 26, 2018 3:25 PM
-
The next line after calling the OptionFocus was a call to sub to load filtered strRecordSource. I moved the call for OptionFocus after call for loading datasheet and error message is gone.
Thank you for your help, again.
Regards,
Savalan
Thursday, July 26, 2018 3:30 PM -
Hi,
You're welcome. Glad to hear you got it fixed. Good luck with your project.
Thursday, July 26, 2018 3:51 PM