By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,455 Members | 2,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,455 IT Pros & Developers. It's quick & easy.

Is there any way to lock fields in a query.

P: n/a
I am trying to find a simple solution for the porblem of error
checking in a project, where at several sites data are entered using MS
Access modules(developed and sent out from the data center of the
project) and periodically submitted to the data center. Query seems a
good solution for specifying all the edit specification checking and
correcting except the following: in each query some of the fields have
to be protected from changes.
I couldn't find how to do this in query. Is it possible at all?
--
V. Moltchanov
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I'm not sure I understand all of what you're doing, but perhaps this
information will help:

In a query, any field which is based on an expression is not updatable.
So, let's say your table has a field named MyNumber, which you want to
protect.
Instead of including MyNumber directly in the query, define a field like
this in your query:
ThisNumber: [MyNumber]+0
ThisNumber will display the same value as MyNumber, but it will not be
editable.
For a string field, you could use:
ThisString: [MyString] & ""
Note that the name you use in the query (before the colon) must be at least
slightly different from the actual field name.

HTH

"Vladislav Moltchanov" <vl******************@ktl.fi> wrote in message
news:cl**********@oxygen.ktl.fi...
I am trying to find a simple solution for the porblem of error
checking in a project, where at several sites data are entered using MS
Access modules(developed and sent out from the data center of the
project) and periodically submitted to the data center. Query seems a
good solution for specifying all the edit specification checking and
correcting except the following: in each query some of the fields have
to be protected from changes.
I couldn't find how to do this in query. Is it possible at all?
--
V. Moltchanov

Nov 13 '05 #2

P: n/a
MacDermott wrote:
I'm not sure I understand all of what you're doing, but perhaps this
information will help:

In a query, any field which is based on an expression is not updatable.
So, let's say your table has a field named MyNumber, which you want to
protect.
Instead of including MyNumber directly in the query, define a field like
this in your query:
ThisNumber: [MyNumber]+0
ThisNumber will display the same value as MyNumber, but it will not be
editable.
For a string field, you could use:
ThisString: [MyString] & ""
Note that the name you use in the query (before the colon) must be at least
slightly different from the actual field name.

Thanks this works,
however, one other problem came, though not so critical, - preventing
the underlying table from appending the new record.
I know the way to solve all these problems would be a form built up on
query. I don't like this way since there well could be about 100 edit
specifications, i.e. queries i.e forms
--
Vladislav Moltchanov
Nov 13 '05 #3

P: n/a
"MacDermott" <ma********@nospam.com> wrote in
news:5C*****************@newsread3.news.atl.earthl ink.net:
For a string field, you could use:
ThisString: [MyString] & ""
Note that the name you use in the query (before the colon)
must be at least slightly different from the actual field
name.

True, but this is perfectly acceptable, at least in Acc97:
MyString: [MyTable].[MyString] & ""
--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #4

P: n/a
So you want to be able to add data to a field in a new record, but not
change an existing record?

AFAIK that's more than Access offers directly in a query view.
It could be accomplished using VBA coding behind a form.

I'm still unclear about just what your "edit specifications" are -
there may be a way around all this...

HTH
- Turtle

"Vladislav Moltchanov" <vl******************@ktl.fi> wrote in message
news:cl**********@oxygen.ktl.fi...
MacDermott wrote:
I'm not sure I understand all of what you're doing, but perhaps this
information will help:

In a query, any field which is based on an expression is not updatable.
So, let's say your table has a field named MyNumber, which you want to
protect.
Instead of including MyNumber directly in the query, define a field like
this in your query:
ThisNumber: [MyNumber]+0
ThisNumber will display the same value as MyNumber, but it will not be
editable.
For a string field, you could use:
ThisString: [MyString] & ""
Note that the name you use in the query (before the colon) must be at least slightly different from the actual field name.

Thanks this works,
however, one other problem came, though not so critical, - preventing
the underlying table from appending the new record.
I know the way to solve all these problems would be a form built up on
query. I don't like this way since there well could be about 100 edit
specifications, i.e. queries i.e forms
--
Vladislav Moltchanov

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.