14d1e Switchboard question!
Sign Up |  Live StatsLive Stats    Articles 37,301| Comments 176,943| Members 19,397, Newest birinder| Online 432
Home Contact
 (Forgotten?): 
    Sikhism
    For best SPN experience, use Firefox Internet Browser!


                                                                   Your Banner Here!    




Switchboard question!

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 500 USD, Received: 100 USD (20%)
Please Donate...
     
Related Topics...
Thread Thread Starter Forum Replies Last Post
Switchboard Manager Gregc. Information Technology 8 28-Jul-2006 08:37 AM
Switchboard Lalitha Information Technology 4 28-Jul-2006 08:29 AM
It's the little things - switchboard Brian Information Technology 1 28-Jul-2006 08:09 AM
Switchboard not working Ken Rosewall Information Technology 1 16-Nov-2005 14:50 PM
Extending Switchboard Ricky Gibson Information Technology 1 15-Nov-2005 14:10 PM


Tags
switchboard, question
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:10 AM
JOM's Avatar JOM
Guest
 
Posts: n/a
   
   
Switchboard question!

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
I would like to enable and disable some of the buttons depending on access
level one has. in my Employee table, I have the following fields EName,
loginID, AccessLevel -- 1 grants all rights while 2 limits the rights ti what
can be accessed. How will I code it so that if your loginID isnot in the
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/10187-switchboard-question.html
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10187
database it provides the msgbox provided below and when one clicks ok, it
should exit.
So on my switchboard in the open event procedure, I have the following
Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.

' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True

AL = DLookup("AccessLevel", "TblEmployee", "LoginID = '" &
Environ("username") & "' ")

If AL = 1 Then
With Me
.Option1.Enabled = True
.Option2.Enabled = True
.Option3.Enabled = True
.Option4.Enabled = True
End With

ElseIf AL = 2 Then

With Me
.Option1.Enabled = True
.Option2.Enabled = False
.Option3.Enabled = False
.Option4.Enabled = True
End With
Else
If IsNull(AL) Then
With Me
.Option1.Enabled = True
.Option2.Enabled = False
.Option3.Enabled = False
.Option4.Enabled = False
End With
End If
MsgBox "You do not have sufficient access to use this database/application" _
& Chr(13) & "See management", vbCritical, "Insufficient Database Access"

End If
End Sub





Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:10 AM
Jeff Conrad's Avatar Jeff Conrad
Guest
 
Posts: n/a
   
   
Re: Switchboard question!

"JOM" wrote in message:
news:7BDCCF68-CC3E-46DC-8544-90FC3C8B4C4E@microsoft.com...

> I would like to enable and disable some of the buttons depending on access
> level one has. in my Employee table, I have the following fields EName,
> loginID, AccessLevel -- 1 grants all rights while 2 limits the rights ti what
> can be accessed. How will I code it so that if your loginID isnot in the
> database it provides the msgbox provided below and when one clicks ok, it
> should exit.
> So on my switchboard in the open event procedure, I have the following

Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10187

Personally I would not use the Environ as that can be easily circumvented.
I would recommend using this code to retrieve the Network User ID:

http://www.mvps.org/access/api/api0008.htm

So using that API call just add in a few more lines of code like so:

If IsNull(DLookup("AccessLevel", "TblEmployee", "LoginID = '" & fOSUserName & "' ")) Then
MsgBox "You do not have sufficient permissions to use this database/application" _
& vbNewLine & vbNewLine & "Please see Management.", vbCritical + vbOKOnly, _
"Insufficient Database Access"
DoCmd.Quit
Exit Sub
Else
AL = DLookup("AccessLevel", "TblEmployee", "LoginID = '" & fOSUserName & "' ")
End If

If you still want to use Environ then just replace that part.

--
Jeff Conrad
Access Junkie - MVP
http://home.bendbroadband.com/conrad...essjunkie.html
http://www.access.qbuilt.com/html/articles.html
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10187


Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:11 AM
Ron2006's Avatar Ron2006
Guest
 
Posts: n/a
   
   
Re: Switchboard question!

  Donate Today!  
Watch out for a possible error situation.

I attempted that same type of thing but I was making the buttons
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10187
visible/not visible. I encountered the problem that when the FIRST
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10187
button was invisible (the user did not have access to that button), the
form would give me an error on opening because it was trying to set the
focus to that button. Enabling may not give you that type of problem.

Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Active Discussions
Panjabi
Today 02:14 AM
9 Replies, 188 Views
Textbooks Spotted...
By akiva
Today 02:14 AM
3 Replies, 20 Views
Fresno Sikh Who Was...
Today 01:30 AM
0 Replies, 9 Views
Guns of the Nihangs...
Today 01:24 AM
0 Replies, 9 Views
Saudi Woman Makes...
Today 01:01 AM
0 Replies, 12 Views
Of Serpents, Pigs,...
Today 00:55 AM
36 Replies, 870 Views
Do you believe in...
Today 00:28 AM
165 Replies, 3,457 Views
Map shows world's 'most...
Yesterday 23:56 PM
7 Replies, 106 Views
The Great Imp Debate
Yesterday 23:12 PM
31 Replies, 457 Views
Thought of the Moment!
Yesterday 20:55 PM
104 Replies, 4,962 Views
Sikhs making Their...
Yesterday 20:51 PM
0 Replies, 61 Views
A Sydney [Aust] man who...
By Ishna
Yesterday 11:04 AM
0 Replies, 60 Views
Sikh Spokesman (ਪੰਜਾਬੀ...
Yesterday 10:42 AM
164 Replies, 4,267 Views
BHOOTS (Ghosts) and...
Yesterday 08:20 AM
91 Replies, 13,707 Views
Before He Was Sir...
Yesterday 05:40 AM
6 Replies, 131 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +6.5. The time now is 02:35 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 1.39222 seconds with 32 queries
0