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

Locking single records in a data entry form

64
I apologize for what is probably a simple solution. I have a data entry form that I use to enter work times. I have the default view set to "continuos forms" and the form is enter through a criteria box. The trick is that I want the user to see all the records according to the criteria box but I don't want the user to be able to edit the existing records but still have the ability to enter new records. I have added a "locked yes/no box in the table to try and key off of but I can't come up with the code to lock a single record.

I hope this makes sense.

Thanks

-Tom
Nov 27 '07 #1
9 21561
JustJim
407 Expert 256MB
I apologize for what is probably a simple solution. I have a data entry form that I use to enter work times. I have the default view set to "continuos forms" and the form is enter through a criteria box. The trick is that I want the user to see all the records according to the criteria box but I don't want the user to be able to edit the existing records but still have the ability to enter new records. I have added a "locked yes/no box in the table to try and key off of but I can't come up with the code to lock a single record.

I hope this makes sense.

Thanks

-Tom
Hi Tom
If you look at the Data tab of the Properties sheet for your data entry form (open the form in design view and click on the properties button on the toolbar) you will see some properties called "Allow Edits", "Allow Deletions" and "Allow Additions".

Make "Allow Edits" = No and "Allow Additions" = Yes and I think you will have what you want.

Jim
Nov 28 '07 #2
tbeers
64
Hi Tom
If you look at the Data tab of the Properties sheet for your data entry form (open the form in design view and click on the properties button on the toolbar) you will see some properties called "Allow Edits", "Allow Deletions" and "Allow Additions".

Make "Allow Edits" = No and "Allow Additions" = Yes and I think you will have what you want.

Jim
Jim,

Thanks

I stumbled across that combination yesterday.

It works...almost.

What I am trying to do is lock specific records from being edited. In other words, once an emplyee enters a time card record, after a certain time of day, I want to lock that record from being edited, assuming one can't get to the tables directly, which I have in a separate folder. I have a "time modified" box which tells me date/time of new record and or record edit. I want to be able to lock a record down for "no edit" after a certain date/time stamp. Am I asking too much?

Thanks

-Tom
Nov 29 '07 #3
tbeers
64
Jim,

Thanks

I stumbled across that combination yesterday.

It works...almost.

What I am trying to do is lock specific records from being edited. In other words, once an emplyee enters a time card record, after a certain time of day, I want to lock that record from being edited, assuming one can't get to the tables directly, which I have in a separate folder. I have a "time modified" box which tells me date/time of new record and or record edit. I want to be able to lock a record down for "no edit" after a certain date/time stamp. Am I asking too much?

Thanks

-Tom
Nov 29 '07 #4
JustJim
407 Expert 256MB
Jim,

Thanks

I stumbled across that combination yesterday.

It works...almost.

What I am trying to do is lock specific records from being edited. In other words, once an emplyee enters a time card record, after a certain time of day, I want to lock that record from being edited, assuming one can't get to the tables directly, which I have in a separate folder. I have a "time modified" box which tells me date/time of new record and or record edit. I want to be able to lock a record down for "no edit" after a certain date/time stamp. Am I asking too much?

Thanks

-Tom
I think you're going to have to move to a single form implementation and, using your check box value as a trigger, set either the "Visible", "Locked" or "Enabled" properties of particular controls on the form.

Jim
Nov 30 '07 #5
tbeers
64
I think you're going to have to move to a single form implementation and, using your check box value as a trigger, set either the "Visible", "Locked" or "Enabled" properties of particular controls on the form.

Jim
Jim thanks for your reply.

So..if an employee wants to look at a range of records, I should just create a report? That just createds an extra step for them. There is no way to lock a single record other than through the "locked" properties on a control. And of course as you know, when using continuous forms, this locks those controls when adding a new record. Is it possible to lock a record from edit at the table level?
Thanks

-Tom
Nov 30 '07 #6
JustJim
407 Expert 256MB
Jim thanks for your reply.

So..if an employee wants to look at a range of records, I should just create a report? That just createds an extra step for them. There is no way to lock a single record other than through the "locked" properties on a control. And of course as you know, when using continuous forms, this locks those controls when adding a new record. Is it possible to lock a record from edit at the table level?
Thanks

-Tom
Well, if you're determined to use continuous forms, you need to make it so that only records that you want to be able to be edited are displayed. (what a convoluted sentence!). You could move the secured records right out of the table and into another table (not the way I'd go) or you could use a filter or query to make sure the form's recordset only has records you want to allow editing on. Your "locking" field would be ideal for this purpose.

I doubt you could lock a record at the table design level since at that level you are not looking at individual records, but at the fields which will make up the records.

Jim
Dec 2 '07 #7
tbeers
64
Thanks...

I knew I was overlooking the obvious. I created a qry that locks records bast a certain date/time and then created two continous but identical forms...one read only, which includes locked records and one for editing which shows only unlocked records.

Thanks

-Tom
Dec 3 '07 #8
sierra7
446 Expert 256MB
Thanks...

I knew I was overlooking the obvious. I created a qry that locks records bast a certain date/time and then created two continous but identical forms...one read only, which includes locked records and one for editing which shows only unlocked records.

Thanks

-Tom
Sounds like you have a solution but if you wanted only one form you might call a check_locked() Sub in the On_Enter of each field they may be tempted to edit.

The Sub would need a test (If . . Then ) for if the data should be locked and a message box, else unlock it
e.g

Expand|Select|Wrap|Line Numbers
  1. Private Sub check_locked()
  2.  
  3. If 'lock condition = true' Then
  4.        Msgbox "Data Locked"
  5.        Me.Field1.Locked = True
  6.        Me.Field2.Locked = True
  7.        .
  8.       .
  9. Else
  10.        Me.Field1.Locked = False
  11.        Me.Field2.Locked = False
  12.        .
  13.        .
  14. EndIf
  15.  
  16. End Sub
Best of lock !!
Dec 3 '07 #9
Handy
1
@sierra7
Thanks. This will meet my needs perfectly.
Nov 17 '18 #10

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

Similar topics

3
by: Ryan | last post by:
I have a problem with record locking / blocking within an application. The app is quite straight forward. Written in Delphi 5 using BDE to access a SQL 7 database (Win2K server). Every so often...
4
by: Sam | last post by:
Hello everyone, I have around 20 reports in an ASP web-application which connects to a SQL Server 2000 dB, executes stored procedures based on input parameters and returns the data in a nice...
3
by: Joe | last post by:
Hi there, question regarding Access 2000 - locking records: I want to be able to lock a record (or several records) on a form so that particular record can not be edited until I undo the lock (im...
1
by: Tom | last post by:
hello i have 2 tables linked by a common id. The first table has records with a specific field with numeric values. eg 3 or 6 or 10 etc. What i want to happen is when i create a data entry form, i...
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: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
1
by: KC | last post by:
Hello, I am using Access 2002. WinXP, Template from MS called Orders Mgmt DB. I have tweaked this DB to work for our small co. It has worked pretty well up until I made the mistake of deleting...
3
by: bosmatthews | last post by:
I have a main form with a subform and a second subform nested to the first subform. The data entry property for all three forms (main, subform and sub-subform) is set to "yes" because I am intending...
3
by: Shukaido | last post by:
I'm a VERY novice SQL user. I've got an Access ADP project connected to an SQL 2000 Server. My dilemma is that I have a single table that stores all data for my particular project, with links...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
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...

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.