Results 1 to 2 of 2

Thread: Table structure for Menu

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2009
    Posts
    135

    Table structure for Menu

    Hi There,

    I need a little help here on how to structure my menu to be place on my Mainform.
    i placed my menu logic on the database(e.g File,View,Edit,Report etc.).So that if my mainform is loaded it automatically populates menu on the menubar and also populate sub-items in the menu (e.g File --> Option etc. straight down).

    My Current Table Structure
    SystemUserMenu table
    ID RoleCode ModuleCode MenuName MenuIndex
    1 , Administrator , File , Option , 1


    SystemMenu table
    ID ModuleCode MenuName DisplayName
    1 , File , Option , My Option


    .my problem is how can i structure my table if there is a sub-items "Find" in the Option sub-items.something like "parent" and "child" implementations.

    Example:
    File
    --Option
    ---Find

    Thanks in advance.
    glen

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Table structure for Menu

    Your table should have an ID column and a ParentID column. This table:
    Code:
    ID  Text     ParentID
    1   File
    2   Project  1
    3   New      2
    4   Open     2
    would then create this menu:
    Code:
    File
        |
        Project
            |
            New
            |
            Open
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

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



Click Here to Expand Forum to Full Width