Lock fields if statusID=1

  • Thread starter Thread starter Harmannus
  • Start date Start date
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
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top