I
Iram
Hello.
I need some help changing some code by one field.
I have ten fields on a form. The first five need to be edited by the person
that created the record and the other five need to be edited by a different
person. One of the ten fields is called "Created By" with a default value of
=fOSUserName()
=fOSUserName() is a module that retrieves the Windows login ID of who ever
is logged into the PC.
I have had help writing the below code (see below) however I need to alter
it to compare if the person logged into the computer is the
same as the record creator "Created By" in order to unlock each of the first
five fields. I plan on putting this code on the Double Click of each of the
first five fields...
I need the code to say something like like...
If =fOSUserName() equals to "Created By". Locked = False
If =fOSUserName() not equals to "Created By". Locked = True
Your help is greatly appreciated.
Iram/mcp
Private Sub FieldName_DblClick(Cancel As Integer)
Dim strUserName As String
strUserName = fOSUserName()
If strUserName = fOSUserName() Then
Me!FieldName.Locked = False
Else
Me!FieldName.Locked = True
End If
End Sub
I need some help changing some code by one field.
I have ten fields on a form. The first five need to be edited by the person
that created the record and the other five need to be edited by a different
person. One of the ten fields is called "Created By" with a default value of
=fOSUserName()
=fOSUserName() is a module that retrieves the Windows login ID of who ever
is logged into the PC.
I have had help writing the below code (see below) however I need to alter
it to compare if the person logged into the computer is the
same as the record creator "Created By" in order to unlock each of the first
five fields. I plan on putting this code on the Double Click of each of the
first five fields...
I need the code to say something like like...
If =fOSUserName() equals to "Created By". Locked = False
If =fOSUserName() not equals to "Created By". Locked = True
Your help is greatly appreciated.
Iram/mcp
Private Sub FieldName_DblClick(Cancel As Integer)
Dim strUserName As String
strUserName = fOSUserName()
If strUserName = fOSUserName() Then
Me!FieldName.Locked = False
Else
Me!FieldName.Locked = True
End If
End Sub