473,785 Members | 2,484 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Prevent Table Updates in a Form

I have a form in Access97 which facilitates a query against a production
Access database. Users will enter some search terms and see a datasheet
view of the results in a subform. The prod table is linked (the form is
not included in the production mdb file). I need to ensure that an
unexperienced user will not accidentally change the prod table. What
measures should I take?

So far I have done the following:

In the subform, set Allow Edits, Allow Deletions, Allow Additions to NO.
In the database, set Tools.Startup.D isplay Form to show the search form
and unchecked "Display Database Window".

Is there anything else I should consider? I expect the average user to
have very limited knowledge of Access.

Regards,
--
Smartin
Nov 13 '05 #1
8 4858
Set the locked property of the subform to True

Smartin wrote:
I have a form in Access97 which facilitates a query against a production
Access database. Users will enter some search terms and see a datasheet
view of the results in a subform. The prod table is linked (the form is
not included in the production mdb file). I need to ensure that an
unexperienced user will not accidentally change the prod table. What
measures should I take?

So far I have done the following:

In the subform, set Allow Edits, Allow Deletions, Allow Additions to NO.
In the database, set Tools.Startup.D isplay Form to show the search form
and unchecked "Display Database Window".

Is there anything else I should consider? I expect the average user to
have very limited knowledge of Access.

Regards,
--
Smartin


Nov 13 '05 #2
Smartin <sm********@yah oo.com> wrote in
news:6c******** ************@gi ganews.com:
I have a form in Access97 which facilitates a query against a
production Access database. Users will enter some search terms
and see a datasheet view of the results in a subform. The prod
table is linked (the form is not included in the production
mdb file). I need to ensure that an unexperienced user will
not accidentally change the prod table. What measures should I
take?

So far I have done the following:

In the subform, set Allow Edits, Allow Deletions, Allow
Additions to NO. In the database, set Tools.Startup.D isplay
Form to show the search form and unchecked "Display Database
Window".

Is there anything else I should consider? I expect the average
user to have very limited knowledge of Access.

Regards,
--
Smartin


1) If the production database has security enabled, consider
creating a read-only user and accessing the table through that
user's login.

2) Create a .mde and distribute the mde to your users instead of
the .mdb

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #3
Bob Quintal wrote:
Smartin <sm********@yah oo.com> wrote in
news:6c******** ************@gi ganews.com:

I have a form in Access97 which facilitates a query against a
production Access database. Users will enter some search terms
and see a datasheet view of the results in a subform. The prod
table is linked (the form is not included in the production
mdb file). I need to ensure that an unexperienced user will
not accidentally change the prod table. What measures should I
take?

So far I have done the following:

In the subform, set Allow Edits, Allow Deletions, Allow
Additions to NO. In the database, set Tools.Startup.D isplay
Form to show the search form and unchecked "Display Database
Window".

Is there anything else I should consider? I expect the average
user to have very limited knowledge of Access.

Regards,
--
Smartin

1) If the production database has security enabled, consider
creating a read-only user and accessing the table through that
user's login.

2) Create a .mde and distribute the mde to your users instead of
the .mdb


Thank you for the suggestions. I can't get the .mde solution to work for
me. Any thoughts?

My form is in an Access database file which doesn't actually contain any
data. The only "table" is linked from the prod .mdb file. I tried making
an .mde out of the prod file and linking to that instead but the result
is the same.

The result is the entire linked table is returned regardless of the
search terms. When I put some search terms in and launch the query, I
still get the entire table back. Since I am setting properties of the
subform object at runtime I'm guessing my problem is related to the
following caveat (found in help under About MDE files):

=== quote
[MDE files prevent] Changing code using the properties or methods of the
Microsoft Access or VBA Object models--an MDE file contains no source code.
=== end quote

Maybe what I really should do is rewrite this as a stand-alone front end
application.
--
Smartin
Nov 13 '05 #4
Smartin <sm********@yah oo.com> wrote in
news:nu******** ************@gi ganews.com:
Bob Quintal wrote:
Smartin <sm********@yah oo.com> wrote in
news:6c******** ************@gi ganews.com:

I have a form in Access97 which facilitates a query against a
production Access database. Users will enter some search
terms and see a datasheet view of the results in a subform.
The prod table is linked (the form is not included in the
production mdb file). I need to ensure that an unexperienced
user will not accidentally change the prod table. What
measures should I take?

So far I have done the following:

In the subform, set Allow Edits, Allow Deletions, Allow
Additions to NO. In the database, set Tools.Startup.D isplay
Form to show the search form and unchecked "Display Database
Window".

Is there anything else I should consider? I expect the
average user to have very limited knowledge of Access.

Regards,
--
Smartin

1) If the production database has security enabled, consider
creating a read-only user and accessing the table through
that user's login.

2) Create a .mde and distribute the mde to your users instead
of the .mdb


Thank you for the suggestions. I can't get the .mde solution
to work for me. Any thoughts?


Lots of questions: What happens when you try to create the .med
of your report file?
My form is in an Access database file which doesn't actually
contain any data. The only "table" is linked from the prod
.mdb file. I tried making an .mde out of the prod file and
linking to that instead but the result is the same.

The result is the entire linked table is returned regardless
of the search terms. When I put some search terms in and
launch the query, I still get the entire table back. Since I
am setting properties of the subform object at runtime I'm
guessing my problem is related to the following caveat (found
in help under About MDE files):
That should not cause a problem. You can change the recordsource
of a subform in an .mde. But the code has to generate the sql
statement entirely,
=== quote
[MDE files prevent] Changing code using the properties or
methods of the Microsoft Access or VBA Object models--an MDE
file contains no source code. === end quote

Maybe what I really should do is rewrite this as a stand-alone
front end application.


You may also want to try the trick of importing the table from
the production databsae, so that even if some hacker messes it
up, the next time the application is opened, it reloads the
data.

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #5
Bob Quintal wrote:
Smartin <sm********@yah oo.com> wrote in
news:nu******** ************@gi ganews.com:

Bob Quintal wrote:
Smartin <sm********@yah oo.com> wrote in
news:6c***** *************** @giganews.com:

I have a form in Access97 which facilitates a query against a
productio n Access database. Users will enter some search
terms and see a datasheet view of the results in a subform.
The prod table is linked (the form is not included in the
productio n mdb file). I need to ensure that an unexperienced
user will not accidentally change the prod table. What
measures should I take?

So far I have done the following:

In the subform, set Allow Edits, Allow Deletions, Allow
Additions to NO. In the database, set Tools.Startup.D isplay
Form to show the search form and unchecked "Display Database
Window".

Is there anything else I should consider? I expect the
average user to have very limited knowledge of Access.

Regards,
--
Smartin
1) If the production database has security enabled, consider
creating a read-only user and accessing the table through
that user's login.

2) Create a .mde and distribute the mde to your users instead
of the .mdb
Thank you for the suggestions. I can't get the .mde solution
to work for me. Any thoughts?

Lots of questions: What happens when you try to create the .med
of your report file?


I assume you meant .mde? The .mde's are generated without any complaint
from Access. No error messages. This is true of both my search file and
the prod database. However

Search MDB + Prod MDB = Works fine
Search MDB + Prod MDE = Works fine
Search MDE + Prod MDB = Fails to query correctly
Search MDE + Prod MDE = Fails to query correctly
My form is in an Access database file which doesn't actually
contain any data. The only "table" is linked from the prod
.mdb file. I tried making an .mde out of the prod file and
linking to that instead but the result is the same.

The result is the entire linked table is returned regardless
of the search terms. When I put some search terms in and
launch the query, I still get the entire table back. Since I
am setting properties of the subform object at runtime I'm
guessing my problem is related to the following caveat (found
in help under About MDE files):


That should not cause a problem. You can change the recordsource
of a subform in an .mde. But the code has to generate the sql
statement entirely,


When the "Search" button is clicked the SQL statement is generated on
the fly as "SELECT {columns} FROM {table} WHERE {conditions};" and
assigned to the subform's RecordSource property.
=== quote
[MDE files prevent] Changing code using the properties or
methods of the Microsoft Access or VBA Object models--an MDE
file contains no source code. === end quote

Maybe what I really should do is rewrite this as a stand-alone
front end application.

You may also want to try the trick of importing the table from
the production databsae, so that even if some hacker messes it
up, the next time the application is opened, it reloads the
data.


Do I understand you correctly... Can I import the data table at runtime
and "disconnect " from the production database? That sounds like a good
way to go. If you can point me in the right direction for how to do this
with VBA I'd appreciate it.

The prod table is updated once a day more or less. I'd like for the
search to always be looking at current data without having to manually
create an .mde every time the prod database is updated.

Thanks again.
--
Smartin
Nov 13 '05 #6
Smartin <sm********@yah oo.com> wrote in
news:d6******** ************@gi ganews.com:
Bob Quintal wrote:
Maybe what I really should do is rewrite this as a
stand-alone front end application.

You may also want to try the trick of importing the table
from the production databsae, so that even if some hacker
messes it up, the next time the application is opened, it
reloads the data.


Do I understand you correctly... Can I import the data table
at runtime and "disconnect " from the production database? That
sounds like a good way to go. If you can point me in the right
direction for how to do this with VBA I'd appreciate it.

Yes, create the code for a delete query and an insert query
using the general form of

DeleteSQL = "Delete * from table1;"
AppendSQL ="INSERT into table1 Alias Target .... SELECT ...
FROM Table1 IN C:\OtherDir\Pro duction.mdb Alias Source;

And execute them from code.

sql.execute strDeleteSQL
sql.execute AppendSQL


The prod table is updated once a day more or less. I'd like
for the search to always be looking at current data without
having to manually create an .mde every time the prod database
is updated.

Thanks again.


--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #7
Bob Quintal wrote:
Yes, create the code for a delete query and an insert query
using the general form of

DeleteSQL = "Delete * from table1;"
AppendSQL ="INSERT into table1 Alias Target .... SELECT ...
FROM Table1 IN C:\OtherDir\Pro duction.mdb Alias Source;

And execute them from code.

sql.execute strDeleteSQL
sql.execute AppendSQL


Thanks for that! OK I've got this working. I copied the prod table into
my database, set up a table to record when refreshes are done, and wrote
some routines fired by the form's open event that check the last refresh
time to see if it's time to refresh again.

More questions?

1. The delete/insert queries take a few minutes to complete. Potentially
other users will try to open the database while updates are in process.
Is there a way to lock out other users while the update is underway and
signal to them to wait a few minutes? This app will deployed on a shared
network resource.

2. What if the prod database is currently in use when a user's instance
determines it's time to refresh? Can I detect this somehow so I can code
around it?

3. Is there a way to capture the current user's name? It's not required
at the moment, but may be useful later.

I seem to be drifting away from my original topic. Thanks for all your help!
--
Smartin
Nov 13 '05 #8
Smartin <sm********@yah oo.com> wrote in
news:X_******** ************@gi ganews.com:
Bob Quintal wrote:
Yes, create the code for a delete query and an insert query
using the general form of

DeleteSQL = "Delete * from table1;"
AppendSQL ="INSERT into table1 Alias Target .... SELECT ...
FROM Table1 IN C:\OtherDir\Pro duction.mdb Alias Source;

And execute them from code.

sql.execute strDeleteSQL
sql.execute AppendSQL
Thanks for that! OK I've got this working. I copied the prod
table into my database, set up a table to record when
refreshes are done, and wrote some routines fired by the
form's open event that check the last refresh time to see if
it's time to refresh again.

More questions?

1. The delete/insert queries take a few minutes to complete.
Potentially other users will try to open the database while
updates are in process. Is there a way to lock out other users
while the update is underway and signal to them to wait a few
minutes? This app will deployed on a shared network resource.

I have my routines fire at 2:00 AM. You can write a command
line that starts a macro, which runs the code and quits the
application. Use the command in Start->settings->scheduled
tasks. It's the only macro in the database, everything else is
in modules
2. What if the prod database is currently in use when a user's
instance determines it's time to refresh? Can I detect this
somehow so I can code around it?
see above or below.

3. Is there a way to capture the current user's name? It's not
required at the moment, but may be useful later.
Yes, see http://www.mvps.org/access/general/gen0034.htm if you
have security enabled, and
http://www.mvps.org/access/api/api0008.htm if you don't


I seem to be drifting away from my original topic. Thanks for
all your help!


That's databse development.... one thing leads to another.

--
Bob Quintal

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
11957
by: Warren Wright | last post by:
Hello, We maintain a 175 million record database table for our customer. This is an extract of some data collected for them by a third party vendor, who sends us regular updates to that data (monthly). The original data for the table came in the form of a single, large text file, which we imported. This table contains name and address information on potential
6
2352
by: RdR | last post by:
Hi, Has anyone encountered infinite looping in Q Replication? This happens when I have a source DB2 table A going to a target DB2 table B, it also happens that the samne target table B is replicated back to source table A (true bi-directional replication scenario). Once I start replication on a master to master scenario the changes in A gets replicated to B but that change gets replicated back to A and so on creating an infinite loop. Is...
4
2147
by: Terry | last post by:
I need some help refining an MS 2000 relational databse. I have created a simple relational database using two tables, 'Student Details', 'Exam Details' and two forms, 'Input/Edit Exam Details', 'Input/Edit Student Details'. 'Student Details' has a field called 'Log Book No' (no duplicates allowed) and this is the Primary Key. 'Exam Details' also has a field called 'Log Book No' (duplicates allowed) and has no Primary Key, (as each...
3
2232
by: Randy | last post by:
I want to set up a table where I can enter dates that will prevent data entry of Dates in the Main table. I have done this in Approach by linking two tables and setting up a validation formula IsBlank (Date.Date). After staff enter dates in the detail table it will prevent dates in the Main table. How can I do that in Access?
4
1704
by: simonmarkjones | last post by:
Hi i need to prevent a textfield on a form from being deleted from but allow updates/ append to any text already stored in the database. How can i do this?
7
3449
by: rockdc1981 | last post by:
i have audit trail module using this code... Option Compare Database Option Explicit Public Function AuditTrail() On Error GoTo Err_Audit_Trail 'ACC2000: How to Create an Audit Trail of Record Changes in a Form 'http://support.microsoft.com/default.aspx?scid=kb;en-us;197592
0
1269
by: =?Utf-8?B?RU1hbm5pbmc=?= | last post by:
(I originally posted this to the data access newsgroup but received no replies) I've got an Access 2003 mdb that I'm converting to VB.Net. I'm having trouble with getting the main data source to update after updates to a lookup table. There are 2 tables with a one-to-many relationship in the mdb. VB.Net recognizes this relationship according to it's dataset designer diagram. Currently I have 2 forms: a main form for data-entry and a...
0
1971
by: jehrich | last post by:
Hi Everyone, I am a bit of a hobby programmer (read newbie), and I have been searching for a solution to a SQL problem for a recent pet project. I discovered that there are a number of brilliant minds hanging around here, and I was hoping someone could point me in the right direction. I'm using MS SQL 2005 and I have created a table of "level changes" that basically stores the device name , the previous level and the new level along...
62
8527
by: Wiretwisterz | last post by:
I am using Microsoft Office XP and I have developed an Access database that is used to schedule conference and training rooms within buildings. I have one main form named "Events" that is used to schedule these rooms. The "Events" form has several fields on it such as "Building" which is a Combo box with the name "cmbBuilding". There's a field below "Building" named "Location" which is called "cmbLocation". The 2 fields Building and...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.