Elegant solution needed for protecting a record in continuous form

R

RzB

I have a continuous form that consists
of a Combo box and a number of text boxes.

I have a situation where I want to stop
the user from updating the combo box and
the text boxes for a particular value in
the combo box.

I also don't want them to delete this
particular record..

For example... see picture below... (3k or 21k)

http://www.gillandroy.com/accessprobs/

I don't want the user to update any of the
record "Percent of Resource Costs". I want it
visible in the list but not editable...

Is there a simple way to do this? I have
been scrabbling for hours with all sorts of
Events like Before Del Confirm, Before Update
but there must be a simpler way...

Anyone got a real elegant way of doing this?

Am using Access 2002, DAO and Win XP.

Many thanks,
Roy
 
A

Allen Browne

Use the Current event of the form to set the Locked property of the
controls.

Use the Delete event of the form, and set Cancel = True if the values are
such that the user should not delete that record.
 
M

Marshall Barton

RzB said:
I have a continuous form that consists
of a Combo box and a number of text boxes.

I have a situation where I want to stop
the user from updating the combo box and
the text boxes for a particular value in
the combo box.

I also don't want them to delete this
particular record..

For example... see picture below... (3k or 21k)

http://www.gillandroy.com/accessprobs/

I don't want the user to update any of the
record "Percent of Resource Costs". I want it
visible in the list but not editable...

Is there a simple way to do this? I have
been scrabbling for hours with all sorts of
Events like Before Del Confirm, Before Update
but there must be a simpler way...

Anyone got a real elegant way of doing this?

Am using Access 2002, DAO and Win XP.


I have no idea what you might consider "elegant", but the
standard way to do this is to use the form's Current event:

Me.AllowEdits = (Me.thecombo <> "Percent of Resource Costs")
Me.AllowDeletions = (Me.thecombo <> "Percent of Resource
Costs")
 
D

David C. Holley

Have you tried using Conditional Formating? CF can be used with
expression such as [Forms]![frmReservations]![txtStatus] = "XCLD" to
DISABLE a control. If there are multiple controls, you'll need to setup
CF for each.
 
Top