473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

switchboard buttons...

jayme
83
I have a db that will be on the network for several people to access..Is there a way to lock certain buttons on the switchboard so that only the admins can have access to them-whereas when the "users" open the db either the buttons aren't there or they are unable to click on them.
Any ideas?
Thank you!
Apr 16 '07 #1
8 2365
Rabbit
12,516 Expert Mod 8TB
In the on load event of the form you can check their status, "user" or "admin" and if they're "admin" then disable or make the buttons invisible.

Here's some pseudocode:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.    If User = "Admin" Then
  3.       but_Name.Visible = False
  4.    End If
  5. End Sub
Apr 16 '07 #2
Denburt
1,356 Expert 1GB
If your database has security setup for User and group permissions then Rabbits idea is best however if you do not then you could use the following, depending on the operating system. I don't think win95,Me,or 98 supports this however it should work when Windows security or AD (active directory) is in place and controlling passwords:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.    If Environ("USERNAME")= "Jayme" Then
  3.       but_Name.Visible = False
  4.    End If
  5. End Sub
Apr 16 '07 #3
jayme
83
the button i am trying to lock/hide opens up another switchboard - would this code still work for that? i've been trying to get it to work for that but am not sure if i am on the right track...theres really only one button i want to do this with on the default switchboard. so i wasnt sure how to specify just to hide that button and all the switchboards under that one-or connected to that certain button.
Apr 17 '07 #4
ADezii
8,834 Expert 8TB
I have a db that will be on the network for several people to access..Is there a way to lock certain buttons on the switchboard so that only the admins can have access to them-whereas when the "users" open the db either the buttons aren't there or they are unable to click on them.
Any ideas?
Thank you!
The only way you can do this is to extract a combination of the UserName and Switchboard Name, not the UserName alone. Because a Switchboard is basically a single Form which is dynamically generated, you must test for 'both' conditions since Button #3 on 1 Switchboard should be accessible to an average User whereas the exact Button on another may not be. If you are interested, let me know and I'll show you where and how to generate the code.
Apr 17 '07 #5
jayme
83
The only way you can do this is to extract a combination of the UserName and Switchboard Name, not the UserName alone. Because a Switchboard is basically a single Form which is dynamically generated, you must test for 'both' conditions since Button #3 on 1 Switchboard should be accessible to an average User whereas the exact Button on another may not be. If you are interested, let me know and I'll show you where and how to generate the code.
that sounds like what i need. basically i have 4 buttons on the default switchboard of which one should only be accessible to admins. so that is the only button that i need locked or hidden when a "user" logs in.
i would appreciate your help! thanks!!
Apr 17 '07 #6
ADezii
8,834 Expert 8TB
that sounds like what i need. basically i have 4 buttons on the default switchboard of which one should only be accessible to admins. so that is the only button that i need locked or hidden when a "user" logs in.
i would appreciate your help! thanks!!
I apologize for reading too much into your question. If the above is all you need, simply place this code in the Switchboard's Open() Event:
Expand|Select|Wrap|Line Numbers
  1. Select Case CurrentUser
  2.   Case "Admin"
  3.     Me![Option3].Enabled = True
  4.   Case "User"
  5.     Me![Option3].Enabled = False
  6.   Case Else
  7.     Me![Option3].Enabled = False
  8. End Select
Apr 17 '07 #7
jayme
83
no thats fine..i had no idea! :-) thanks so much for your help. that works perfectly! thank you so much!!
Apr 17 '07 #8
ADezii
8,834 Expert 8TB
no thats fine..i had no idea! :-) thanks so much for your help. that works perfectly! thank you so much!!
You're welcome.
Apr 17 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Mark | last post by:
I am looking for a switchboard creator alternative for my MDB. Can anyone help me? Thanks for your help, Mark
0
by: Wesclitz | last post by:
Hello, I've done much research on this one but still cannot figure it out...I have a database that was converted from 97 to 2000 a while back, which has a switchboard. Two associates received new...
2
by: Terry | last post by:
I have created a switchboard, created using Access 2000. If I put the mouse anywhere on the form, outside of the checkboxes and scroll the wheel backwards, I get the following error. Run-Time...
4
by: Rampar | last post by:
I did some customizing on my switchboard (changing colors and adding graphics) to make it more appealing. I tried to add another item, and it told me that 8 was the limit. Fine. I deleted one...
2
by: Neil Greenough | last post by:
I am trying to create a Switchboard using the Switchboard Manager in MS Access 2000. I have managed to get the table created for the switchboard, however it hasn't actually created the form. ...
1
by: mplus_2000 | last post by:
I have recently inherited a database. The switchboard (and other forms) displays the name of the database on it (top, center). Currently the name that appears is Reviews. There are plans to roll...
2
by: colmkav | last post by:
Is there a way of adding more than the 8 items to a switchboard on Access 97? If so how? Colm
4
by: David Grist | last post by:
Is there any way to by-pass the limitation of only 8 items on the switchboard menus? Thanks!
2
by: Doug | last post by:
MS Access 2000 Help says there is an Switchboard Manager in Tools->Add-ins. Only Add-in Manager is there, and no Add-ins are listed. Clicking Add New takes me to an Add-ins directory on C: (empty...
2
by: Earl Anderson | last post by:
In Acc2003, I have a situation in which I have a main switchboard and upon pressing one of its buttons , takes the user to another sub hierarchical switchboard. Pressing one of these buttons could...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.