Protect a record of a table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I’d like to set default values for the fields of a record that a user should
not be able to change or delete the record.
Is it possible ?

Thanks
GL
 
GL,

It is certainly possible to set default values for fields. And you can
also set up your forms in such a way that the user cannot edit the data.

However, I'm not all that clear what you want to do. What you told us
would mean that every record would be the same as each other, and could
not be changed, which doesn't seem right. Can you give an example?
 
When a new record is added to a form I want its fields to take the values of
a certain record as default values. These values are set in limit to list
comboboxes. So the user is free to change these values to the new record but
not to change the values of the original record or delete it.
In other words I want to protect just a one record of the table the one that
I have set the default values.
 
GL,

Here are a few random thoughts, which I hope will help.

It is unusual to want to take the default values from an existing
record. Can you say why you want to do this? If the values in the
"default" record will be changed from time to time, then I suppose it
could make some sense. Otherwise, why not just set the default values
in the table design or form design?

Another approach might be to create a separate table, solely to hold the
values you want to lookup for your defaults for new records. That way,
you wouldn't need to worry about the record being edited in the working
form.

Another approach might be to use the form's Record Source to make the
record holding the default values in accessible. In other words, base
the form on a query, and in the query you can set the criteria so that
the record with the defaults is not included.

Another approach might be to use code to handle this. For example, on
the form's Before Update event, something like this...
If Me.DoodadID = 77 Then
MsgBox "Must not change this record."
Cancel = True
Me.Undo
End if
 

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