473,383 Members | 1,929 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,383 software developers and data experts.

Locking a form

6
I have a database that was created so that 4 separate shops could go
in and enter pertinent information about how their shops ran
throughout the day so that my boss (and theirs) could report out to
his boss at the end of the day about how things went. Each shop has
its own form to enter their information. I gave them separate forms
bound to 4 separate tables because the information gathered from each
shop is unique. Each form opens with the following code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer) 
  2.     DoCmd.Maximize 
  3.     DoCmd.OpenForm "ShopDailyfrm", , , "txtDate = Date()" 
  4. End Sub
So that they always see each day's information and can go in multiple
times throughout the day to add and update data / comments. The
database then creates one report containing the information
for all 4 shops that my boss uses to report out to his boss.

Problem is that there are multiple users adding information to the
tables. I have told the users within each shop that there should
only be one person in the shop specific form at a time. I have one
shop that does not always adhere to this and some days I end up
with multiple records. My hope is to prevent this by "locking-out"
the form to one user at a time. I thought by checking the "Edited
Record" radial on the advanced Options tab would elminate multiple
records, but it hasn't.

Can anyone assist me in locking the form to one user at a time?

I am running Access 2003 on Windows XP.
Oct 14 '07 #1
6 1587
MMcCarthy
14,534 Expert Mod 8TB
In Advanced Options, change the Default Open mode from Shared to Exclusive. This will only allow one user to open the database to enter or edit records at a time. All other users will only be able to open it as Read Only.

Locking to Edited record only locks the record currently being edited.
Oct 14 '07 #2
NeoPa
32,556 Expert Mod 16PB
I suspect that locking the entire database (open exclusive) would also stop the other shops from doing their work. As they all use different tables try setting the locking mode to "All records". This should simply lock the table for the shop.
Oct 14 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
I suspect that locking the entire database (open exclusive) would also stop the other shops from doing their work. As they all use different tables try setting the locking mode to "All records". This should simply lock the table for the shop.
Reading between the lines I don't think they are all on the same database, just copies. I could be wrong though.
Oct 14 '07 #4
Trees
6
Reading between the lines I don't think they are all on the same database, just copies. I could be wrong though.
They are all in the same database, so making the database open exclusive will not suit my needs.
Oct 14 '07 #5
Trees
6
I suspect that locking the entire database (open exclusive) would also stop the other shops from doing their work. As they all use different tables try setting the locking mode to "All records". This should simply lock the table for the shop.
I will try this, thank you for the advice.
Oct 14 '07 #6
NeoPa
32,556 Expert Mod 16PB
I will try this, thank you for the advice.
No problems. I hope it works for you.
Oct 14 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: Nid | last post by:
How do I do row-level locking on SQL Server? Thanks, Nid
3
by: Elias Farah | last post by:
Dear Access Peers, I am having a problem over a network, where the Database takes 5-Mins to load instead of the normal 5 seconds. It has only started to do this since I split the frontend &...
0
by: ethanj /personal/ | last post by:
We are using Access 2000 database, with the following settings. Tool > Options > Advance > Default Record Locking = Edited Record Open databases using record level locking = True Form...
6
by: MS | last post by:
Access 97 here. I want a simple way to "lock" certain records on a form. Some records remain "live" until all data is available which happens over time. When all the fields are complete, I want...
5
by: jaking01 | last post by:
Hi. I am currently working on a form that I need to prevent changes to after data has been input. There are a series of tick boxes on the form, and when each one of these is ticked it spawns...
1
by: wheel | last post by:
I have been ok with optimistic locking most of the time but I have a situation now where there is more of a chance that users could try to edit a record at the same time. I'd like to use pessimitic...
10
by: Ami | last post by:
Hello everyone, I have developed a small access application and now I need to lock my forms against unwanted edits. I have used the code by Allen Browne I found here...
9
by: zmickle | last post by:
Experts and books all say that you can share an Access back end on a shared drive with the front end running on each host computer. I have a simple database that tracks student data and it is...
3
by: kstevens | last post by:
I have turned on record locking do to the fact that we are starting to have issues with the records not being locked. I have a button on a form that changes the recordsource of the form. When i...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.