Can I forbid updates on just one field and not to forbid inserts

  • Thread starter Thread starter ljubo lecic via AccessMonster.com
  • Start date Start date
L

ljubo lecic via AccessMonster.com

I am new in access and my question is:
I have a simple form with several fields.Is it possible to set properties
to one of these fields (just one)
in a way that the field can not be updated(others fields
can).So far, whenever I forbid updates I also forbid inserts.
I must say that I solved this problem programaticly
(by recognizing when before-update event is called within inserts and when
standalone ) but
I feel that it must be simplier solution.
 
I am new in access and my question is:
I have a simple form with several fields.Is it possible to set properties
to one of these fields (just one)
in a way that the field can not be updated(others fields
can).So far, whenever I forbid updates I also forbid inserts.
I must say that I solved this problem programaticly
(by recognizing when before-update event is called within inserts and when
standalone ) but
I feel that it must be simplier solution.

Open the Form in Design view.
Select the control you want to not be changed.
Set it's Locked property to Yes (it's on the Data tab).
 
I will try again but I think that if I set the locked property to YES
inserts are forbidden too.
 
ljubo lecic via AccessMonster.com said:
I am new in access and my question is:
I have a simple form with several fields.Is it possible to set properties
to one of these fields (just one)
in a way that the field can not be updated(others fields
can).So far, whenever I forbid updates I also forbid inserts.
I must say that I solved this problem programaticly
(by recognizing when before-update event is called within inserts and when
standalone ) but
I feel that it must be simplier solution.

Yes. Let's call the field [MyField]. In the On Open property of the form,
set code to be run:

If Not IsNull(Me![MyField]) Then
Me![MyField].Locked = True
End If

Tom Lake
 
Back
Top