Hide a page tab on form using VBA for current user

Tor_Fey

Registered User.
Local time
Today, 12:25
Joined
Feb 8, 2013
Messages
121
Good Day All;

I am looking to hide page tabs on my form for a current user; I have tried the following 'onload' event:

Code:
If Me.loggedon = jblog Then
Me.TabCtl6.Pages(0).Visible = False
End If

Please not: the field: 'loggedon' is an unbound text field which source is set to =currentuser()

The above code doesn't work, the tabs are always showing regardless, if someone could point me in the right direction on this matter; it would greatly be appreciated. :banghead:

Regards
Tor Fey
 
Last edited by a moderator:
Try:-

Code:
 If currentuser() = jblog Then
Me.TabCtl6.Pages(0).Visible = False
End If

Sent from my SM-G925F using Tapatalk
 
Hi Uncle Gizmo;

Thanks for the reply, unfortunately I have tried this code and it doesn't seem to work either? Is there any other way of doing this?

Regards
Tor Fey

Try:-

Code:
 If currentuser() = jblog Then
Me.TabCtl6.Pages(0).Visible = False
End If
Sent from my SM-G925F using Tapatalk
 
Instead of "currentuser()" try a known value in the list in "jblog" and see what results you get
 
What is jblog? If it's a user name it probably needs to be in Quotes, i.e.

"jblog"

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom