Results 1 to 10 of 10
  1. #1
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168

    Minimize Access database to Taskbar .. and Send Focus to control on Form issues

    I have 2 issues. They are probably small to fix but I am picky and cannot get Access to do what I want.



    So .. I have my database pinned to the Taskbar (Windows 8.1) .. and it runs fine. However .. I would like it to minimize to the Taskbar, just like a normal application.

    Right now .. it minimizes to the left on the screen above the Taskbar. I also never want to see the database window .. just my form.

    So .. help on how to achieve that would be good. I only have 1 form .. with about 15 tabs on it. Makes it simple .. maybe.

    But also .. when the database opens again .. I want to have it give focus to a control on one of the tabs.

    My form is named: frmMainSwitchboard and the Tab Control is named: TabCtl0 and a SubForm: subSearchId and the control: txtSearch.

    The issue is that my form opens on that tab .. but the tab control does not really have focus and I have to click on the window before I can type.

    What is the syntax to ensure that when the form opens that one control (in this case a text box) gets the focus ?
    Last edited by edmscan; 10-19-2014 at 10:32 PM. Reason: spelling error

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Hiding the Access application frame requires some advanced VBA using API. Review http://www.tek-tips.com/faqs.cfm?fid=2562

    Where is the control you want to have focus? Perhaps you just need to set TabOrder property.
    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
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    The focus to the control on the subform on my tab is a much bigger issue .. any thoughts ?

    Unless I physically click on the form it does not have focus, even though the cursor is blinking in the text box control.

  4. #4
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    Ok .. did the Form code and well it is fine .. not quite what I wanted but close enough. It is exactly how I had it.

    The form opens up to the required tab but I want it to set focus to a text box control on the subform on that tab.

    As above .. here are the control names.

    My form is named: frmMainSwitchboard and the Tab Control is named: TabCtl0 and a SubForm: subSearchId and the control: txtSearch.

    I have this on the Open event of my main form .. doesn't work. Unless I click on the main form window with my mouse .. it does not actually have focus.

    Me.subSearchId.SetFocus
    Me.subSearchId.Form.txtSearch.SetFocus

  5. #5
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    I kinda found my issue on the set focus .. I forgot that my Splash Screen is opened before the form in question. So .. if I open my main form first and disregard the splash screen it works just fine.

    So .. how do I ensure that my main form receives the focus after my splash screen closes.

    I have this in the unload of my splash screen to load the 2nd main form. But .. it is not quite what I want.

    DoCmd.OpenForm FormName:="frmMainSwitchboard"

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Not sure. I do have a form with subforms on tab control and seems focus is set to control on subform just by setting focus to page of tab control.
    Code:
    ...
    If .pge6.Visible Then
        .pge6.SetFocus
    ElseIf .pge1.Visible Then
        .pge1.SetFocus
    ElseIf .pge2.Visible Then
        .pge2.SetFocus
    ElseIf .pge3.Visible Then
        .pge3.SetFocus
    ElseIf .pge4.Visible Then
        .pge4.SetFocus
    ElseIf .pge5.Visible Then
        .pge5.SetFocus
    End If
    ...
    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.

  7. #7
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    Ok .. thanks I will give it a try. For right now .. I have gotten rid of the splash screen and go directly to the main form and it is fine. But I would like that splash screen back if I could.

  8. #8
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    Ok .. well the window code above didn't reliably get rid of the database window (which is blank btw .. but still there behind my main form). I removed the code. I just cannot find a way to make access more like an application with one form that I can reliably minimize.

    So far the only solution is the disable the splash screen .. and go to the main form directly, if I do that .. there are no problems and things work as expected.

    Re your code above .. the big issue seems to be that I cannot get the splash screen to give focus to the main form. That should be a simple thing .. ? But guess not. I have to actually click on the form to give it focus .. it has a light gray title bar .. which changes to a slightly darker color when it gets focus .. and then the control had the needed focus.

    This is the real issue .. giving focus to the main form. Once it has focus .. then the control on my subform works just fine.

    The sad part .. is that my app worked 100% fine until I added the tabs. When I used a switchboard with all separate forms .. none of these problems existed. But I really do like the tabs so I am conflicted.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    I have 'splash' screen, sort of. It is a login form that only shows if user is new. That form closes and the main menu form opens. However, my main menu form has only buttons, not data controls. The first button has focus. So I just tested a textbox on the main menu with TabOrder set to 0. The textbox now gets focus. Cursor is in the textbox and I can just start typing, no click on form first.

    My code:
    DoCmd.OpenForm "Menu", acNormal, , "UserInitials='" & Me.tbxUser & "'", , acWindowNormal
    DoCmd.Close acForm, Me.Name, acSaveNo

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  10. #10
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    I have very good news ... I read the info on the link you posted and realized I made an error. Oops ... read 3x and do it once.

    I had the code for the hiding of the database in my Main Form .. and not my splash screen. The difference is that .. it made the database window have the focus and not my main form when it opened.

    It is now working correctly ... no database window at all and I have focus with no clicking.

    This one is closed. I did it mostly right .. just put my call to the hide macro in the wrong form and that made all the difference in the world in this case.

    Thanks June

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

Similar Threads

  1. Replies: 15
    Last Post: 04-11-2015, 08:15 AM
  2. Replies: 1
    Last Post: 03-20-2013, 07:04 AM
  3. Focus on Key Control
    By windwardmi in forum Access
    Replies: 1
    Last Post: 09-07-2011, 04:57 PM
  4. Form Minimize Issue
    By Tomfernandez1 in forum Forms
    Replies: 8
    Last Post: 05-18-2011, 05:32 PM
  5. Minimize access window problem
    By McHammer in forum Forms
    Replies: 2
    Last Post: 04-24-2010, 05:14 AM

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