Results 1 to 13 of 13
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to Build Custom Menu? (a2k (9.0.3821) SR-1 Jet 4.0)

    How to Build Custom Menu?
    a2k (9.0.3821) SR-1 Jet 4.0

    I have the following function that retrieves a customer code from /cmd switch when the application is launched

    =GetPref("Profile Code")

    Based on the profile code I want to dynamically build a custom menu

    The Menu title is Applications

    For Customer TOA I want to build the following:

    Applications
    Building Permits (with all properties to open form)
    Engineering Permit (with all properties to open form)

    For Customer TOB I want to build the following:

    Applications
    Building Permits
    Plumbing Permits

    Is there any documentation on how to dynamically build a custom menu?

    Thanks, John

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: How to Build Custom Menu? (a2k (9.0.3821) SR-1 Jet 4.0)

    There isn't really any documentation on how to do that sort of thing - we use a custom menu system that we built to modify the menu bases on the login of the user (you can see an example on our website). There is a current thread <post#=279458>post 279458</post#> on a very similar topic where <!profile=shimmer>shimmer<!/profile> is trying to customize the standard switchboard based on the user ID.
    Wendell

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to Build Custom Menu? (a2k (9.0.3821) SR-1 Jet 4.0)

    Hi Wendell

    I thought I read somewhere you could create customized menus, not switchboards, based on login prompt and/or /cmd prompt.

    Thanks, John

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How to Build Custom Menu? (a2k (9.0.3821) SR-1 Jet 4.0)

    You can. Just create custom menu or toolbars and load them in your startup code based on the group the user is in.
    Charlotte

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to Build Custom Menu? (a2k (9.0.3821) SR-1 Jet 4.0)

    Hi Charlotte

    I have the following selections on a custom Application menu and all users have access to all, I want to restrict users to their appropriate choices:

    Application
    Application 1
    Application 2
    Application 3
    Application 4
    Application 5

    When Username Bob clicks Application I want him to have the following choices:

    Application 1
    Application 3
    Application 5

    When Username Sue clicks Application I want her to have the following choices:

    Application 2
    Application 4

    Without using groups how would I load menus in startup code?

    Can these custom menus be stored in a table and loaded at application startup?

    Thanks, John

  6. #6
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to Build Custom Menu? (a2k (9.0.3821) SR-1 Jet 4.0)

    Hi Wendell

    You said:

    <we use a custom menu system that we built to modify the menu bases on the login of the user (you can see an example on our website). >

    Where specifically do I find this?

    Thanks, John

  7. #7
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: How to Build Custom Menu? (a2k (9.0.3821) SR-1 Jet 4.0)

    Sorry, I should have posted this link - the user menu is displayed on the left-hand side.
    Wendell

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to Build Custom Menu? (a2k (9.0.3821) SR-1 Jet 4.0)

    John, you could create two tables:

    tblMenuItems

    <table border=1><td>ItemID</td><td>Caption</td><td>OnAction</td><td align=right>1</td><td>Application 1</td><td>=StartApp(1)</td><td align=right>2</td><td>Application 2</td><td>=StartApp(2)</td><td align=right>3</td><td>Application 3</td><td>=StartApp(3)</td></table>
    (etc.)

    tblItemUsers

    <table border=1><td>ItemID</td><td>User</td><td align=right>1</td><td>Bob</td><td align=right>1</td><td>Designer</td><td align=right>2</td><td>Designer</td><td align=right>2</td><td>Sue</td><td align=right>3</td><td>Bob</td><td align=right>3</td><td>Designer</td><td align=right>4</td><td>Designer</td><td align=right>4</td><td>Sue</td><td align=right>5</td><td>Bob</td><td align=right>5</td><td>Designer</td></table>
    (etc.)

    Create a query qryMenuItems:

    SELECT tblMenuItems.* FROM tblMenuItems INNER JOIN tblItemUsers ON tblMenuItems.ItemID = tblItemUsers.ItemID WHERE tblItemUsers.User = CurrentUser();

    In the startup code of your database, open a recordset on this query, and loop through its records. Use this to create the menu. If you need help with the code to create a menu, post back.

  9. #9
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to Build Custom Menu? (a2k (9.0.3821) SR-1 Jet 4.0)

    Help!

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to Build Custom Menu? (a2k (9.0.3821) SR-1 Jet 4.0)


  11. #11
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to Build Custom Menu? (a2k (9.0.3821) SR-1 Jet 4.0)

    Hi Hans

    Thanks for the link.

    Your menu and user table approach in previous post is what I would loke to accomplish. Are there any sample db/code to illustrate your previous comments:

    <In the startup code of your database, open a recordset on this query, and loop through its records. Use this to create the menu.>

    Thanks, John

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How to Build Custom Menu? (a2k (9.0.3821) SR-1 Jet 4.0)

    John,

    I have added a simple demo database that combines the code from the MSKB article and the idea of looping through the records of a query to create menu items. Look at the basMenuCode module, and run CreateCustomMenu to create the menu, and DeleteCustomMenu to delete it.

    The menu items only display a message box through the StartApp function. In reality, you would put a Select Case statement in this function to make the menu items perform various actions. You can also create individual functions for each menu item (modify the OnAction field in tblMenuItems for this.)

    I created the database in Access 2002 in Access 2000 format. It has references to DAO (the code could be modified to use ADO instead) and to the Microsoft Office n.0 Object Library; if this displays as missing in Tools | references..., uncheck the box, close the dialog, reopen it and set a reference to the Microsoft Office 9.0 Object Library.
    Attached Files Attached Files

  13. #13
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to Build Custom Menu? (a2k (9.0.3821) SR-1 Jet 4.0)

    Wow!

    This is a must have keeper.

    This has been on my back burner for almost a year.

    A demo is worth a 10,000 words.

    This is more than enough to get me started

    HOW TO: Create Command Bars by Using Visual Basic Code in Access 2000 makes for good reading now.

    Thanks, John

Posting Permissions

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