Results 1 to 2 of 2

Thread: User Acces In A Loop

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2001
    Location
    West Palm Beach, Florida
    Posts
    188

    User Acces In A Loop

    I would like to loop through all my menu's on the main form then do a findfirst in a database file based on the menu name and check the record to see if the user is allowed access. If the returned value is false (or 0) then I want to be able to disable the menu function else It must be Enabled.

    How would I do that without using Menu Aray Index's

  2. #2
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Hi
    I would prob enable/disable or hide/show the menu options at the time of a new user logging in.. ie keep a record of what menus they have access to and only enable them. This would be a one off check and hence much faster than checking each time a menu item is clicked...

    but, to give u the idea to get u on ur way here is code to output the name of each menu item
    regards
    Stuart
    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim Mnu As Control
    3.     For Each Mnu In Me.Controls
    4.         If TypeOf Mnu Is Menu Then Debug.Print Mnu.Name
    5.     Next
    6. End Sub
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

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