Lock fields if statusID=1

H

Harmannus

Hallo,

I have a form with prospects: fields prospectid, name, address etc. and a
field statusID.

Is there a way to disable editing and deleting of all the fields of the
statusID for a prospect is like 1? If the statusID is changed to 2 editing
should be possible again...

Tried some if then statements behind the on opent event but can't get it to
work.

Thanx in advance for any tips.

Regards,

Harmannus
 
F

fredg

Hallo,

I have a form with prospects: fields prospectid, name, address etc. and a
field statusID.

Is there a way to disable editing and deleting of all the fields of the
statusID for a prospect is like 1? If the statusID is changed to 2 editing
should be possible again...

Tried some if then statements behind the on opent event but can't get it to
work.

Thanx in advance for any tips.

Regards,
Harmannus
In the Forms Current event:
If Me![StatusID] = 1 Then
Me.AllowEdits = False
Me.AllowDeletions = False
Else
Me.AllowEdits = true
Me.AllowDeletions = True
End If
 
H

Harmannus

Hallo,

Thanx for the response!

Works great.

Thanx.


Regards,
Harmannus

Hallo,

I have a form with prospects: fields prospectid, name, address etc. and a
field statusID.

Is there a way to disable editing and deleting of all the fields of the
statusID for a prospect is like 1? If the statusID is changed to 2 editing
should be possible again...

Tried some if then statements behind the on opent event but can't get it to
work.

Thanx in advance for any tips.

Regards,
Harmannus
In the Forms Current event:
If Me![StatusID] = 1 Then
Me.AllowEdits = False
Me.AllowDeletions = False
Else
Me.AllowEdits = true
Me.AllowDeletions = True
End If
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.
 
Top