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.
 

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

Similar Threads

Disable edit all but 1 field? 7
Order/invoicenumber? 2
Menubar 2
Access Form - Lock Fields from Editing 0
VBA last character \ 4
Show subform data on new/update record 1
Selected field color? 1
Disable scrollwheel? 3

Top