Results 1 to 3 of 3
  1. #1
    1989Shea is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Mar 2018
    Location
    Missouri
    Posts
    1

    Caption command buttons from table and associate "on click" event


    Hello folks!

    I am working on a project where I want to have one user form with sixteen command buttons. These command buttons will change their caption based on the "user group" that is selected when the user entered the MS Access application. I would like to store a list of these command button captions in a table and control if the command button is visible. I figured I could do an "on form load" with VBA code that will loop 0 to 15 and find the user group, caption, visibility of each command button. The challenge is how to connect the action or "on click" trigger to match the button caption that has been assigned. Any ideas for that portion?

    Thanks in advance for your thoughts and insight on this one.

    -Shea

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You may be able to use ActiveControl and the caption property.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Welcome to the forum.....


    Not sure what you are trying to do, since you didn't give examples..

    Let's say the buttons are laid out in a 4 X 4 arraignment and the flow is from left to right , then down.
    Click image for larger version. 

Name:	Buttons16.png 
Views:	5 
Size:	5.0 KB 
ID:	33113
    There are 3 groups: BOSS (has access to all buttons), USER (has access to odd buttons) and GUEST (has access to buttons #1 and #16).

    If I log in as USER are there gaps in the layout?
    Click image for larger version. 

Name:	ButtonsOdd.png 
Views:	5 
Size:	3.6 KB 
ID:	33114
    Or are the active buttons adjacent? (1 to 8)
    Click image for larger version. 

Name:	ButtonsOddClose.png 
Views:	5 
Size:	3.2 KB 
ID:	33115


    Are the actions of the buttons fixed, or are the actions based on the button visible?

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

Similar Threads

  1. Replies: 2
    Last Post: 09-21-2017, 06:36 PM
  2. Replies: 2
    Last Post: 12-23-2015, 09:32 PM
  3. Replies: 1
    Last Post: 09-03-2014, 03:27 AM
  4. Replies: 2
    Last Post: 10-02-2013, 01:02 PM
  5. Replies: 21
    Last Post: 06-03-2009, 05:54 PM

Tags for this Thread

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