Using box to block user access

G

GD

I'm trying to block access to a form using boxes to cover sensitive areas, if
the user doesn't have the auth to view them, based on a table.

Private Sub Form_Current()
If DLookup("[Level]", "tblUsers", "[UserID]='" & CurrentUser() & "'") >
1 Then
CoverBox4.Visible = True
Else
CoverBox4.Visible = False
End If

End Sub

I am currently a level 2 user, but the cover box doesn't appear when I open
the form. What am I doing wrong??

Thanks for your time!
 
J

Joshua A. Booker

GD,

I would start by debugging the dlookup. Paste the dlookup call into the
debug window, precede it with a ? and hit enter. This will print the value
returned by the function. If null is printed then, troubleshoot your
dlookup in the debug window until you get the level 2 answer you are looking
for. Perhaps the currentuser() function doesn't return a value that is in
tblusers.

HTH,
Josh
 
D

Dale Fye

Onother option is rather than adding boxes to your form to cover a control,
just hide the control.

The problem may be that the box is behind the control you are trying to hide.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.



Joshua A. Booker said:
GD,

I would start by debugging the dlookup. Paste the dlookup call into the
debug window, precede it with a ? and hit enter. This will print the value
returned by the function. If null is printed then, troubleshoot your
dlookup in the debug window until you get the level 2 answer you are looking
for. Perhaps the currentuser() function doesn't return a value that is in
tblusers.

HTH,
Josh
GD said:
I'm trying to block access to a form using boxes to cover sensitive areas,
if
the user doesn't have the auth to view them, based on a table.

Private Sub Form_Current()
If DLookup("[Level]", "tblUsers", "[UserID]='" & CurrentUser() & "'") >
1 Then
CoverBox4.Visible = True
Else
CoverBox4.Visible = False
End If

End Sub

I am currently a level 2 user, but the cover box doesn't appear when I
open
the form. What am I doing wrong??

Thanks for your time!
 
T

The Morrisons

Do you know how I can find out how to correct (unknown error 4362) so I can
send and receive messages again.

Thank you,
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top