lock the field (1 Viewer)

accessman2

Registered User.
Local time
Today, 08:47
Joined
Sep 15, 2005
Messages
335
Hi,

I create the datasheet form,
I know how to lock the field, but it lock the whole column of the field.
I want to lock the field except the last record field only.
Can I do that?

eg.
ID Field1 Field2
1___a______b
2___c______d
3___z

I want to lock the field2 except the ID=3

Please let me know, thanks.
 

mpb.vu2

Registered User.
Local time
Today, 22:47
Joined
May 31, 2005
Messages
41
I have tested the following code, it locks the field t1 except the last record...
You may try and/or improve it...

Private Sub Form_Current()
If id.Value < DMax("[id]", "[YourForm]") Then
t1.Enabled = False
Else
t1.Enabled = True
End If
End Sub

(in the table remove the ID default value as 0... you can otherwise have to improve the code further)
 

Users who are viewing this thread

Top Bottom