Limit Access to Specific Form

DeLaMartre

New Member
Joined
May 12, 2002
Messages
31
Is there a relatively simple way (being simple-minded...) to limit access to a particular form for which there is a button on the switchboard? I want to make one of the forms accessible only to the manager of the department.

Could a password be assigned to a button/form?

Any help would be greatly appreciated.

Thanks very much,

Bob in California
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
If it's on the computer or part of the operating system, you can use it.
For me, internally, I could go after our internal network login userid - which would restrict use of the forum to the specific computer(s) that the Manager has logged into.

Anything could get a password though.
Create a small form that is triggered by the button in question that does one thing, prompt for and process a password via a textbox. If correct, it closes and opens the next form.

There are other options. Others might be easier/better.

Mike
 
Upvote 0
Thanks for the very creative, brilliant tip, Mike! This is absolutely Perfect!!

Your time is very much appreciated.

Best Regards,

Bob in California
 
Upvote 0
And I wasn't even done talking too - just wait til I get warmed up!
Here is an example of how to access a network login name.

Mike

Code:
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
    "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Public Function fOSUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As String
    strUserName = String$(254, 0)
    lngLen = 255
    lngX = apiGetUserName(strUserName, lngLen)
    If (lngX > 0) Then
        fOSUserName = Left$(strUserName, lngLen - 1)
    Else
        fOSUserName = vbNullString
    End If
    'MsgBox fOSUserName
End Function
 
Upvote 0
I know this is an old post, but I'm curious....Why not just use something like this:


Sub getUserName()

MsgBox Mid(Environ(33), 10)

End Sub
 
Upvote 0

Forum statistics

Threads
1,221,845
Messages
6,162,350
Members
451,760
Latest member
samue Thon Ajaladin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top