UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Tab Control    
 
   
grazird
post Nov 7 2007, 02:16 PM
Post #1

UtterAccess Veteran
Posts: 401
From: Olympia, WA



Hi all,

I have a form with a tab control on it. I only want one of the tabs to be accessible to certain people, and to display an "Access Denied blah blah..." MsgBox to those who are not authorized to view the tab. I have that working, properly, which brings me to my problem. For those who are not authorized to access the tab, I would like to kick them back to whichever tab they were most recently on.

The only thing I have been able to come up with is to kick users back to a specific tab that I have coded...

Here is what I have so far:

CODE
Private Sub tabMain_Change()

    'Display error message if users attempt to go to OP tab
    If Me.tabMain.Value = 5 Then
        
        If Me.txtUserName <> "Robert Grazia" Then
            Me.tabMain.Value = 0
            MsgBox ("Access Denied")
        
        End If
    
    End If

End Sub


As you can see, when a user without proper access attempts to click this particicular tab, this code displays a MsgBox and kicks them back to the very first one.

Is there any way to write this code to send users back to whichever tab they were on?

Any help is greatly appreciated! As always, feel free to ask for any additional details!

Robert
Go to the top of the page
 
+
Larry Larsen
post Nov 7 2007, 02:23 PM
Post #2

UA Editor + Utterly Certified
Posts: 22,722
From: Melton Mowbray,Leicestershire (U.K)



Hi
Why not simply hide the tab if Me.txtUserName <> "Robert Grazia"..??
Then there's no tab(5) for them to click on..
(IMG:http://www.utteraccess.com/forum/style_emoticons/default/thumbup.gif)
Go to the top of the page
 
+
grazird
post Nov 7 2007, 02:42 PM
Post #3

UtterAccess Veteran
Posts: 401
From: Olympia, WA



Hmmm... I suppose that would work! I'll give that a shot.

Just for my own knowledge, I'm assuming that what I originally requested is not possible?

Thanks, Larry!

Robert
Go to the top of the page
 
+
grazird
post Nov 7 2007, 02:42 PM
Post #4

UtterAccess Veteran
Posts: 401
From: Olympia, WA



Hmmm... I suppose that would work! I'll give that a shot.

Just for my own knowledge, I'm assuming that what I originally requested is not possible?

Thanks, Larry!

Robert
Go to the top of the page
 
+
Larry Larsen
post Nov 7 2007, 02:44 PM
Post #5

UA Editor + Utterly Certified
Posts: 22,722
From: Melton Mowbray,Leicestershire (U.K)



Hi
Yes.. possible by using a global variable to hold the page number..
(IMG:http://www.utteraccess.com/forum/style_emoticons/default/thumbup.gif)
Go to the top of the page
 
+
grazird
post Nov 7 2007, 03:03 PM
Post #6

UtterAccess Veteran
Posts: 401
From: Olympia, WA



That sounds very tricky... I think I'll stick with your suggestion. (IMG:http://www.utteraccess.com/forum/style_emoticons/default/wink.gif)

Thanks, again.

Robert
Go to the top of the page
 
+
Larry Larsen
post Nov 7 2007, 03:09 PM
Post #7

UA Editor + Utterly Certified
Posts: 22,722
From: Melton Mowbray,Leicestershire (U.K)



Hi
Check out a : Previous Post : on the subject..
(IMG:http://www.utteraccess.com/forum/style_emoticons/default/thumbup.gif)
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 23rd May 2013 - 07:50 PM