Screaminxpert
New to Access
- Local time
- Today, 12:08
- Joined
- Nov 23, 2008
- Messages
- 18
Hi,
New to this site so hello to everyone
I posted a question in a news group regarding hiding or showing contents of a field depending on the group a person was assigned to. I have been supplied with some code but I am having difficulties getting it to work...
I have a table called 'Rights', this has two fields one called Employee and the other is called SecurityLevel, the Employee field is linked to the Employees table in the database. I can now assign each user with a security level of any number I choose but will be working on the basis of 50 No Access, 100 Full Access.
The code I am using is the following...
rivate Sub Form_Open(Cancel As Integer)
Dim x
x = DLookup("SecurityLevel", "Rights", "Employee =" & "'" &
Me.Employee & "'")
Me.txtLevel = x
If Me.txtLevel >= 50 Then
Me.SubContactPositionsButton.Visible = True
Me.ViewJobCostButton.Visible = True
End If
End Sub
I am getting compile errors when I use this code and as I am new to programming and access 2007 I am a little lost as to what to do next.
The code is a sample provided in a newsgroup so it is not exactly what I want.
I need the code to apply a Password Input mask to a field called 'Card Number' after update and only display the content of the field if the Employee accessing the record has a security level of 100 anything lower and it remains masked.
I would really appreciate if someone could give me the correct code to do what I am trying to do.
Thanks and sorry for the long post
New to this site so hello to everyone

I posted a question in a news group regarding hiding or showing contents of a field depending on the group a person was assigned to. I have been supplied with some code but I am having difficulties getting it to work...
I have a table called 'Rights', this has two fields one called Employee and the other is called SecurityLevel, the Employee field is linked to the Employees table in the database. I can now assign each user with a security level of any number I choose but will be working on the basis of 50 No Access, 100 Full Access.
The code I am using is the following...
rivate Sub Form_Open(Cancel As Integer)
Dim x
x = DLookup("SecurityLevel", "Rights", "Employee =" & "'" &
Me.Employee & "'")
Me.txtLevel = x
If Me.txtLevel >= 50 Then
Me.SubContactPositionsButton.Visible = True
Me.ViewJobCostButton.Visible = True
End If
End Sub
I am getting compile errors when I use this code and as I am new to programming and access 2007 I am a little lost as to what to do next.
The code is a sample provided in a newsgroup so it is not exactly what I want.
I need the code to apply a Password Input mask to a field called 'Card Number' after update and only display the content of the field if the Employee accessing the record has a security level of 100 anything lower and it remains masked.
I would really appreciate if someone could give me the correct code to do what I am trying to do.
Thanks and sorry for the long post