Disable Record in Form

Haytham

Registered User.
Local time
Today, 22:59
Joined
Jun 27, 2001
Messages
162
Hi All...
I have a tabular form, shows names of users with their passwords.
If UserName in any record is Admin, I want to disable this record only while other records remain enabled.
I tried:

If Me.UserName = "Admin" Then
Me.UserName.Enable = False
Else
.....
End If

But it disabled all the UserNames for all the records.
Is it possible to disable one record only in a tabular form..

Many thanks
 
Try this Haytham:

Private Sub Form_Current()

' code is fired on the OnCurrent event of the form
'as user moves record to record


If Me.LenKey = 19 Then
Me.LLastName.Enabled = False
Me.LFirstName.Enabled = False

' etc.

Else
Me.LLastName.Enabled = True
Me.LFirstName.Enabled = True
' etc.

End If

End Sub

Couldn't find a way to lock the whole record, but this will get the job done. You need to consider renaming UserName for this field as it is is one of those reserved names I believe.

[This message has been edited by jwindon (edited 01-29-2002).]
 
True jwindon. This will do the job.
Thanks a lot.
 

Users who are viewing this thread

Back
Top Bottom