473,385 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Is there any way to lock fields in a query.

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
4 9076
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
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Richard Holliingsworth | last post by:
Hello: I have an Access 2K form I built from a SQL Server 7.0 view. I want to lock certain fields in the database from users so they can see them on the views and forms, but NOT be able to edit...
3
by: rkusenet | last post by:
Hi, Version Info: SQLSERVER 2000 SP3 I am trying to understand how SQL Server works with SERIALIZABLE read. I am fairly new to SQL Server, having mainly worked with Informix. We are getting...
18
by: Robert | last post by:
Hi! I was wondering if the was any way to determine the state of the caps lock key, on or off. Of course I can capture the key events and see whether the caps lock is pressed, but that does not...
8
by: Roy Padgett | last post by:
I have a combo box where users select the customer name and can either go to the customer's info or open a list of the customer's orders. The RowSource for the combo box was a simple pass-through...
3
by: Invalid | last post by:
I launch a worker thread that periodically reads a volatile bool abortRequested, which could be set to true by my main form. IOW, there is one thread that can read that bool and one different...
0
by: Nashat Wanly | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaskdr/html/askgui06032003.asp Don't Lock Type Objects! Why Lock(typeof(ClassName)) or SyncLock GetType(ClassName) Is Bad Rico...
0
by: Alvin A. Delagon | last post by:
I have a multithreaded application that spawns threads which query a database server. During stress test I encountered some threads failing due "lost connection errors" and sometimes the actual...
94
by: Samuel R. Neff | last post by:
When is it appropriate to use "volatile" keyword? The docs simply state: " The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock...
3
by: pedalpete | last post by:
I think this is pretty easy to build, but not sure how well it will scale, and therefore if it will actually work. I am trying to attach an indexer to a request so that as a search query gets...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.