If Nz(DLookup("HasAccess", "qryUserAccess", "FormName = 'DocumentControlNav' AND [username]='" & UserName() & "'"), False) = False Then
Example from my db that sets properties of pages of Tab control:
Code:
Private Sub ShowTabs()
With Me
.tbxSet = TestSet(.tbxLABNUM, "Soils & Aggregate")
.pge1.Visible = True
.pge2.Visible = True
.pge3.Visible = True
.pge4.Visible = True
.pge5.Visible = True
.pge6.Visible = True
.tbxLABNUM.SetFocus
'use Val to capture characters preceeding :### which will be present if gradation test selected
If Not Val(.tbxSet) Like "*1*" Then
.pge1.Visible = False
End If
If Not Val(.tbxSet) Like "*2*" Then
.pge2.Visible = False
End If
If Not Val(.tbxSet) Like "*3*" And Not Val(.tbxSet) Like "*E*" Then
.pge3.Visible = False
End If
If Not .tbxSet Like "*P*" Then
.pge4.Visible = False
End If
If Not .tbxSet Like "*V*" Then
.pge5.Visible = False
Else
.pge2.Visible = False
End If
If Not .tbxSet Like "*H*" Then
.pge6.Visible = False
End If
If .pge6.Visible Then
.pge6.SetFocus
ElseIf .pge1.Visible Then
.pge1.SetFocus
ElseIf .pge2.Visible Then
.pge2.SetFocus
ElseIf .pge3.Visible Then
.pge3.SetFocus
ElseIf .pge4.Visible Then
.pge4.SetFocus
ElseIf .pge5.Visible Then
.pge5.SetFocus
End If
End With
End Sub