473,396 Members | 1,965 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,396 software developers and data experts.

Form load / disabled button

6
The codes are working in admin account, but in user account once the Main form is close and open again all the button are already enabled.

Please help. thanks
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. On Error Resume Next
  3.     If Not IsNull(Me.OpenArgs) Then
  4.     Me.lblUserType.Caption = Me.OpenArgs
  5.     Me.cmdLogout.SetFocus
  6.     Me.Caption = " "
  7.     Call Disabled
  8. End If
  9. End Sub
  10.  
  11. Public Sub Disabled()
  12. On Error Resume Next
  13.     If (Me.lblUserType.Caption) <> "Admin" Then
  14.     Me.cmdAdmin.Enabled = False
  15.     Me.cmdInventory.Enabled = False
  16. Else
  17.     Me.cmdAdmin.Enabled = True
  18.     Me.cmdInventory.Enabled = True
  19. End If
Feb 5 '17 #1
0 870

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

Similar topics

1
by: chad.arimura | last post by:
I've got a form inside a PHP script that posts to itself, does some processing on the PHP side, and if it looks good, PHP sends a HEADER command that redirects the user out. All was fine until I...
0
by: Andy Bates | last post by:
Hi - I have a ToolBar with 32-bit colour icons. It looks really good, but I need to disable some of the buttons. When I do this, I get a grey blob where the image has been converted into a...
2
by: Sveta | last post by:
Hi all! C# question: Does anyone knows how to make a toolbar button image to make visible for a disabled button? When the toolbar button is disabled, only the gray hole is displayed instead...
5
by: Al Sav | last post by:
I have the following in form load. When the form shows up, the graphics vanishes. This works, if I execute this from button_click. But, even that vanishes if minimize and restore the form. Similar...
2
by: Pascal | last post by:
bonjour/hello I have an application with several forms : form1 is loaded at first. Man makes some staff (filling text box, clicking radiobutton) in this window and then click nextbutton and so on...
3
by: Ronald S. Cook | last post by:
In my Win app, I'm needing to load a media file into my Windows Media Player control, and THEN read an attribute from the file. The thing is, the file has to be playing for a split second before...
2
by: Zytan | last post by:
If you have a disabled button in a form (or tabpage) whose background color is customized, the text on the disabled button will not be gray. In fact, it becomes a *brighter* version of the...
6
by: bijeshputhalath | last post by:
Hi, I am a new bi in asp... I need to call a function in asp with vb script in form load...without button fire. please give sample code... Thanks and Regards,
1
by: DenverBigDad | last post by:
I have an access database that I am developing for use each day. I am a relatively inexperienced vba user, so I am using/reusing a lot of code that I have developed for specific tasks, learning new...
0
by: coderbot | last post by:
I want to show the IP address whenever the form load without clicking the button to show IP address. This is my code: Function GetIP() As String Dim IP As New WebClient ...
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: 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
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
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.