Restrict query fields

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

Guest

hi there.

I want to know how to lock certain fields in form (which is based on a
query) so if the user tries to change them it wont affect my data tables?
 
andresmor said:
hi there.

I want to know how to lock certain fields in form (which is based on a
query) so if the user tries to change them it wont affect my data
tables?

You can either ...

* Lock the controls on your form using the Locked property of each one

* base those fields on an expression that has no effect on the data. For
example; for Text fields you can replace the fields in the query with columns
based on expressons like...

FieldName: Substring([TableName]![FieldName], 1)

The output of the field will have the same name and output as the original field
but will not be editable since it is based on an expression. For numeric fields
you can use an expression that adds zero to the field.
 
Rick said:
You can either ...

* Lock the controls on your form using the Locked property of each one

* base those fields on an expression that has no effect on the data. For
example; for Text fields you can replace the fields in the query
with columns based on expressons like...

FieldName: Substring([TableName]![FieldName], 1)

The output of the field will have the same name and output as the
original field but will not be editable since it is based on an
expression. For numeric fields you can use an expression that adds
zero to the field.

My work in other databases is showing through :-)

The example expression above obviously should have been made using the Mid()
function rather than Substring().

FieldName: Mid([TableName]![FieldName], 1)
 
Back
Top