+ Reply to Thread
Results 1 to 9 of 9

Thread: Menu System

  1. #1
    Barn Newbie Henley12 is an unknown quantity at this point Henley12's Avatar
    Join Date
    Oct 2009
    Posts
    19
    Rep Power
    3

    Menu System

    I am looking to build a menu system that will list all my databases and allow me to click to open whichever I choose. Can someone point me in the right direction?

  2. #2
    Moderator don94403 is a jewel in the rough don94403 is a jewel in the rough don94403 is a jewel in the rough don94403's Avatar
    Join Date
    Mar 2008
    Location
    San Mateo, CA, USA
    Posts
    313
    Blog Entries
    8
    Real Name
    Don Ravey
    Rep Power
    6

    Quote Originally Posted by Henley12 View Post
    I am looking to build a menu system that will list all my databases and allow me to click to open whichever I choose. Can someone point me in the right direction?
    Although that's possible, I wouldn't advise that you try to do that, for several reasons. First, you must realize that Access can only have one database open at a time, so as soon as you chose a database, the application which the menu is in would be closed, so you couldn't return to it; then, how would you find "all" your databases? You could put them all in one directory, I suppose, but that's generally not a good way to organize your hard drive.

    I would suggest that you focus on either using Windows Explorer or possibly a Windows Scripting Host (WSH) script that presents a menu of all files with ".mdb" extension. I would not attempt to do it from within Access.
    question = 2B || !2B

  3. #3
    Barn Newbie Henley12 is an unknown quantity at this point Henley12's Avatar
    Join Date
    Oct 2009
    Posts
    19
    Rep Power
    3

    Not quite true.

    That's not exactly true. At least, in Access 2007, I can have more than one database open at the same time.

  4. #4
    Barn Regular boblarson will become famous soon enough boblarson's Avatar
    Join Date
    Jul 2008
    Location
    Portland, Oregon
    Posts
    66
    Blog Entries
    1
    Real Name
    Bob
    Rep Power
    4

    Quote Originally Posted by Henley12 View Post
    That's not exactly true. At least, in Access 2007, I can have more than one database open at the same time.
    Yes, I was going to say the same thing. What is true is that any one INSTANCE of Access can only have one database open at any one time but you can open another instance of Access to do it.

    Sample code for you to open from a combo box if the bound field is the full path and name of the database:

    Code:
    Function OpenNewDatabase(strDatabase As String)
        Dim appAcc As Access.Application
        
        Set appAcc = New Access.Application
        appAcc.Visible = True
        
        appAcc.OpenCurrentDatabase (strDatabase)
        appAcc.UserControl = True
        
    End Function
    
    code for the combo box's after update event:

    Code:
    OpenNewDatabase Me.ComboBoxNameHere
    
    Bob Larson
    Access MVP (2008-2009, 2009-2010, 2011-2012)

    Free samples and tutorials: http://www.btabdevelopment.com



  5. #5
    Barn Newbie Henley12 is an unknown quantity at this point Henley12's Avatar
    Join Date
    Oct 2009
    Posts
    19
    Rep Power
    3

    Working, but....

    I have it opening the database, but it opens in a half-window. Is there a command to make it open fully?

  6. #6
    Barn Newbie Henley12 is an unknown quantity at this point Henley12's Avatar
    Join Date
    Oct 2009
    Posts
    19
    Rep Power
    3

    Any ideas?

    Any ideas on this one? I like this way of doing it, but it opens the database in a half-window.

  7. #7
    Barn Enthusiast sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69's Avatar
    Join Date
    Mar 2008
    Location
    The frigid northern plains
    Posts
    432
    Rep Power
    7

    try this link
    Join our Folding team: DeveloperBarn Folding
    -----------------------------------
    Folding Stats - Stanford University
    Folding Stats - Extreme Over-Clocking
    Folding Stats - Kakao Stats
    Folding Stats - Xtreme CPU

    -----------------------------------

  8. #8
    Barn Newbie Henley12 is an unknown quantity at this point Henley12's Avatar
    Join Date
    Oct 2009
    Posts
    19
    Rep Power
    3

    Can't access

    I can't access that link from work. Any other ideas?

  9. #9
    Barn Enthusiast sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69 is a jewel in the rough sbenj69's Avatar
    Join Date
    Mar 2008
    Location
    The frigid northern plains
    Posts
    432
    Rep Power
    7

    Quote Originally Posted by http://hubpages.com/hub/MS_Access_Tips_Maximize_MS_Access_Window
    Call this function in autoexec macro for example:


    Function AccessMaximize()

    AccessMaximize = ShowWindow(GetAccesshWnd(), SW_MAXIMIZE)

    End Function

    where GetAccesshWnd is defined by:


    Function GetAccesshWnd()

    Dim hWnd As Integer

    Dim hWndAccess As Integer


    ' Get the handle to the currently active window.

    hWnd = GetActiveWindow()

    hWndAccess = hWnd


    ' Find the top window without a parent window.

    While hWnd <> 0

    hWndAccess = hWnd

    hWnd = GetParent(hWnd)

    Wend


    GetAccesshWnd = hWndAccess


    End Function



    which uses these declarations:

    Declare Function GetActiveWindow Lib "User32" () As Integer

    Declare Function GetParent Lib "User32" (ByVal hWnd As Integer) As Integer


    Declare Function ShowWindow% Lib "User32" (ByVal hWnd%, ByVal nCmdShow%)


    Global Const SW_MAXIMIZE = 3

    Global Const SW_SHOWNORMAL = 1

    Global Const SW_SHOWMINIMIZED = 2
    Hope this helps!
    Join our Folding team: DeveloperBarn Folding
    -----------------------------------
    Folding Stats - Stanford University
    Folding Stats - Extreme Over-Clocking
    Folding Stats - Kakao Stats
    Folding Stats - Xtreme CPU

    -----------------------------------

+ Reply to Thread

Similar Threads

  1. VB.Net Dynamic Recursive Menu
    By jmurrayhead in forum .NET Code Samples
    Replies: 14
    Last Post: July 9th, 2010, 09:47 PM
  2. Flash interactive wave menu
    By Rangerbob5 in forum Multimedia
    Replies: 7
    Last Post: November 24th, 2009, 10:47 AM
  3. Drop UP Menu
    By noFriends in forum HTML & CSS Help
    Replies: 8
    Last Post: May 20th, 2009, 09:10 AM
  4. Trying to keep a sub-menu open
    By bryceowen in forum JavaScript Programming
    Replies: 1
    Last Post: February 20th, 2009, 12:03 PM
  5. Menu Buttons Tips/Suggestions
    By Rebelle in forum HTML & CSS Help
    Replies: 3
    Last Post: December 23rd, 2008, 08:26 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO