D
DubboPete
Hi all,
I have a form for user administration.
Only managers ([userlevel] = 2) and administrators ([userlevel] = 3) can
access this page.
By means of a combo box selection I can display any user's details on the
form, including users with a [userlevel] greater than the person actually
viewing the details.
On the form I have all user details, including one particular field called
[userlevel]
I have another field called [text30] which does a Dlookup and finds the
current user's [userlevel].
To change a person's [userlevel] I have an option group [Frame11], and that
works fine and dandy too. These are the three options:
User - value=1
Manager - value=2
Administrator - value=3
I click on one of the three options, and the [userlevel] is changed.
What I am trying to do is stop anyone with a [userlevel] of 2 from altering
and administrator's (3) access level. I thought I had the code worked out,
but it works in the opposite direction! When I am logged in as Manager
(userlevel]=2) I can change an administrator's rights from 3 to 2 or 1.
But when I try and move him back up to 3, I get the error message described
below in the code!
Question: where is the code going wrong please?
Here's the code:
<snip>
If (Me.[Text30].Value < Me.[userlevel].Value) Then
MsgBox "Naughty Person! You will now explode.", vbInformation
Exit Sub
Else
Me.[userlevel].Value = Frame11.Value
End If
</snip>
tia
Goat-Herder
I have a form for user administration.
Only managers ([userlevel] = 2) and administrators ([userlevel] = 3) can
access this page.
By means of a combo box selection I can display any user's details on the
form, including users with a [userlevel] greater than the person actually
viewing the details.
On the form I have all user details, including one particular field called
[userlevel]
I have another field called [text30] which does a Dlookup and finds the
current user's [userlevel].
To change a person's [userlevel] I have an option group [Frame11], and that
works fine and dandy too. These are the three options:
User - value=1
Manager - value=2
Administrator - value=3
I click on one of the three options, and the [userlevel] is changed.
What I am trying to do is stop anyone with a [userlevel] of 2 from altering
and administrator's (3) access level. I thought I had the code worked out,
but it works in the opposite direction! When I am logged in as Manager
(userlevel]=2) I can change an administrator's rights from 3 to 2 or 1.
But when I try and move him back up to 3, I get the error message described
below in the code!
Question: where is the code going wrong please?
Here's the code:
<snip>
If (Me.[Text30].Value < Me.[userlevel].Value) Then
MsgBox "Naughty Person! You will now explode.", vbInformation
Exit Sub
Else
Me.[userlevel].Value = Frame11.Value
End If
</snip>
tia
Goat-Herder