Results 1 to 5 of 5
  1. #1
    bbxrider is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Posts
    69

    form.setfocus not really working

    I have a main menu form, it is the default form when the db is opened.
    from it there is the button to get to form_1 and other forms.


    after the work gets done on form_1 I want to return there in case there is more
    work to be done. so just before the form_1
    exit sub I issue the forms!form_1.set focus
    However, I still return to menu form. The form_1 tab is highlighted for it being
    in focus but even if I click its tab it still does not display.
    I have also tried setting the focus to a control on form_1 but that does not get
    it displayed either. so how to get actually displayed and usable as well as having focus?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Return to form_1 from where?

    I don't like Tabbed Documents - I always set database for Overlapping Windows. Tabbed Documents might be part of the issue.
    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
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    To be honest, I'm having trouble following all of your explanation, but a Form cannot receive Focus if there are any Controls on the Form that can receive Focus.

    FWIW, I strongly agree with June7 vis-à-vis the use of the Tabbed Documents for the Document Window Option! This option is really designed to provide a 'plug-and-play' type of capability to Access for people with little experience in or desire to learn programming. It's really meant to be used by clicking on the Tab of the Form you want to open.

    For things like moving from one Form to another Form, using code, you really need to switch the option to Overlapping Windows; it's the very first thing I do when creating a new file.

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

    All posts/responses based on Access 2003/2007

  4. #4
    bbxrider is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Posts
    69
    thanks for the confirming replies, I did switch to overlapping and seems to work fine now, I guess tabbing is helpful/convenient if you are developing with lots of open windows, takes a little more management of them in overlapping. But for sure its the mode to use for a finished product for non tech users

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I prefer developing with Overlapping Windows because I can view objects side-by-side, such as multiple open tables and queries.
    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.

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

Similar Threads

  1. Proper Use of SetFocus?
    By rpeare in forum Forms
    Replies: 14
    Last Post: 10-21-2013, 02:58 PM
  2. Replies: 5
    Last Post: 06-18-2013, 10:40 PM
  3. SetFocus after MsgBox
    By NISMOJim in forum Programming
    Replies: 18
    Last Post: 12-12-2012, 08:44 PM
  4. setfocus on an textbox
    By white_flag in forum Access
    Replies: 2
    Last Post: 09-21-2011, 04:16 AM
  5. Setfocus Split Form Issues
    By cksm4 in forum Programming
    Replies: 6
    Last Post: 10-13-2010, 02:46 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