Solved Security for buttons in switchboard (1 Viewer)

isladogs

MVP / VIP
Local time
Today, 08:38
Joined
Jan 14, 2017
Messages
18,186
I wasn't trying to sound critical of what you have achieved
I know what its like to pursue a route which gets ever more complex.
Sometimes its better to step back and look at alternative approaches to a problem.
I would still suggest using the tag property would have been much simpler ... but its your choice

As I said the issue with gaps would have occurred whichever approach you had used.
You could reassign controls so the first X are visible whatever the user level but their functions may vary in each case (fairly easy)
Or you could move controls up to fill the gaps (more complex)
Or disable controls rather than hide them (very easy)
Or just put up with having gaps...

Anyway, good luck!
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 08:38
Joined
Jul 9, 2003
Messages
16,245
If you are using the VBA version of the Microsoft Access Switchboard utility, then I don't think you should try and move the controls up to fill the gaps. The Microsoft Switchboard Builder Code is what is normally referred to as a "Data Driven" System.

It makes more sense to adjust the data, not the position of the text boxes. I think you should renumber the items to remove the gaps.

I did something similar with my own version of the Microsoft Switchboard Manager --- See this Video:-


Nifty Switchboard Builder - Fix Missing Row



The Nifty Switchboard Builder is HERE:-

https://www.niftyaccess.com/nifty-switchboard-builder/

If you would like a copy of the Nifty Switchboard Builder - Contact me and I will explain how you can get in for free...
 

oxicottin

Learning by pecking away....
Local time
Today, 04:38
Joined
Jun 26, 2007
Messages
851
@Uncle Gizmo Look at UpdateDesignOrder() in sfrm_MenuEditor which fixes the issue you show in your video.

@isladogs I know you want I just was explaining and wanted to give my appreciation for the advice!
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:38
Joined
Feb 19, 2002
Messages
42,981
Here's a slightly different take on a switchboard builder. It uses a subform so you only see rows for which there is data. There is rudimentary security in the app and you could use it to filter the rows shown by the switchboard although I'm not sure that I actually implemented that feature, it was something I considered.
 

Attachments

  • SwitchboardForm20200921.zip
    1.6 MB · Views: 135

oxicottin

Learning by pecking away....
Local time
Today, 04:38
Joined
Jun 26, 2007
Messages
851
Here's a slightly different take on a switchboard builder. It uses a subform so you only see rows for which there is data. There is rudimentary security in the app and you could use it to filter the rows shown by the switchboard although I'm not sure that I actually implemented that feature, it was something I considered.
@Pat Hartman You had given me that example before and that's where I had used some of it for what I have. In your frmSwitchboard example you are using TempVars is that how your achieving the buttons that only populate or is it just that your using a query to populate them? I also like the image for the button but I couldn't get it to work with I have, maybe you could explain both and i'll give her a shot!
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:38
Joined
Feb 19, 2002
Messages
42,981
I used a Tempvar because for some reason I never figured out, I had trouble using a form field reference in the subform's query. Normally I would have used a form field reference. But, yes, the security level is what is controlling what records populate the subform.

I changed the data to make it easier to see how the security works. The reports menu has 3 versions of the same report. One is marked as low, the second as medium and the third as high. When you log in as "pat", you see all three. When you log in as "pat_medium" you see the first two. When you log in as "pat_low" you see only the first one. I think this is what you are looking for. The switchboard uses the "view" security level. You have to put code in the appropriate form events to make use of the add/change/delete security.

Remember, this is an example. I think it all works but it hasn't been rigorously tested.

The Icons work using copy/paste. Find an icon you like and copy it to the switchboard. Go to a new row in the icons subform and paste it. Then paste again to use it in the switchboard.
 

Attachments

  • SwitchboardForm20201003.zip
    1.6 MB · Views: 108

oxicottin

Learning by pecking away....
Local time
Today, 04:38
Joined
Jun 26, 2007
Messages
851
@Pat Hartman I hadnt downloaded the example you posted I got mine working using the TempVars + my security ect but with the subform like you showed previously so only the buttons your allowed is visible and with no gaps... I will post a copy once I get the icons added in I haven't messed with that yet.

I do want to ask what images can I use? .bitmap, Jpg ??

Moving along now :)
 

oxicottin

Learning by pecking away....
Local time
Today, 04:38
Joined
Jun 26, 2007
Messages
851
OK, Here is a final version of a Switchboard "Well So Far" and I like how it turned out. Using Pat Hartmans idea with the TempVars and a subform I was able to only show button depending on what security AND it orders the buttons instead of leaving gaps like previous versions.
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:38
Joined
Feb 19, 2002
Messages
42,981
Please use the site methods to upload images.
 

Users who are viewing this thread

Top Bottom