473,413 Members | 2,056 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,413 software developers and data experts.

Quick Script question about Form buttons

33
I have a database with a login interface. The login works by reading off information off of a table with a list of users. On this table I have field called USER_ACCESS_LEVEL which denotes which user belong to the group ADMINS or USERS. Within the database, I also have a form with several buttons on it. Now depending on the group a user belongs to I want that user to have some buttons activated and the remaining button disabled. For the sake of simplicity let's assume that I have 2 users, USER_1 and USER_2. USER_1 belongs to the ADMINS group and USER_2 is a member of the USERS group. Let's assume further that the form with just 2 buttons, BUTTON_1 and BUTTON_2. When USER_1 logs in, BUTTON_1 should activate while BUTTON_2 becomes disabled. The opposite happens when USER_2 logs in.
Jul 17 '08 #1
1 1123
Stewart Ross
2,545 Expert Mod 2GB
Hi. You can enable or disable the buttons on your form in the On Load event handler of the form itself. You would need to test the user access level, and I do not know how you do that in your case. Assuming that a direct test is possible, the following code in On Load should give you ideas to check out:

Expand|Select|Wrap|Line Numbers
  1. Dim AdminUser as Boolean
  2. AdminUser = (user_access_level = "ADMINS") ' - substitute whatever is correct in your own case
  3. Me!Button1.enabled = AdminUser
  4. Me!Button2.enabled = Not AdminUser
-Stewart
Jul 20 '08 #2

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

Similar topics

0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.