Results 1 to 8 of 8
  1. #1
    sanderson is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    64

    Runtime error 2110, cannot move focus to control

    I have a program that works great on my user login, but not for another user with less rights. When I speak of rights, I am speaking of the windows login.

    To my knowledge, nothing on the control should be producing anything different. I am wondering if there is perhaps something in the knowledge base that would say to do it differently.

    The syntax is: cboXXXX.SetFocus.



    Thanks,

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    I would use Me. prefix, otherwise what you have should work.

    Why would network login interfere with setting focus? What rights are denied this user?

    Is there code behind the form that is dependent on user?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    well - the error message would be triggered if the control is not visible or if the control is explicitly set to Tab = No....... perhaps one of these 2 conditions is in play.....

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by NTC View Post
    ...or if the control is explicitly set to Tab = No...
    Do you mean the property so the Tab key will not be able to set focus on the control? I don't think I have ever experienced that causing a conflict with the .SetFocus method.

  5. #5
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    the Tab property of a control....which is found in the Other section of a control's properties..... If the control is set to No tabbing to it....then vba that attempts to .SetFocus to it will be in conflict; just the same as if the control is not visible.....

  6. #6
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Regarding the tab order, I disagree - at least that is not the behaviour of version 2007. I removed two listboxes from the tab order on a test form and alternately set the focus to one, then the other upon form opening - no problems.

  7. #7
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Quote Originally Posted by NTC View Post
    If the control is set to No tabbing to it....then vba that attempts to .SetFocus to it will be in conflict
    Not in v2007.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I am not remembering an application where I specifically setfocus on a control where the TabStop = No. However, I know I have not concerned myself with making sure I do not try this via code. So it is concerning to me whether or not this is an issue. I built an example app and I was unable to observe a conflict between TabStop = No and SetFocus.
    Attached Files Attached Files

Please reply to this thread with any new information or opinions.

Similar Threads

  1. runtime error '2110'
    By pbouk in forum Forms
    Replies: 8
    Last Post: 03-13-2014, 02:43 PM
  2. Set Focus causes RunTime Error 2108
    By ResearchRN in forum Programming
    Replies: 8
    Last Post: 12-12-2012, 08:32 AM
  3. runtime error 2110
    By Mclaren in forum Programming
    Replies: 9
    Last Post: 07-07-2011, 01:02 PM
  4. Replies: 5
    Last Post: 06-10-2011, 03:31 PM
  5. Replies: 0
    Last Post: 02-22-2011, 04:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums