Solved

Locking record question

Posted on 2013-06-11
9
556 Views
Last Modified: 2013-07-04
I have a split form for entering test results.  There can be a hundred results to enter - so many lines on the bottom datasheet portion and a larger top portion with a couple option controls, memo box and several fields.  (So wouldn't work well in continuous form)  

My user is having trouble keeping track of what line she is on when entering results and would like to be able to have a check box or something to "lock" each record when she is done entering the results.  She would also like to have that line display in a different colour but from what I've been reading that isn't possible in datasheet view like in the split form.  So, I'm hoping I can at least put in the locking function for one record at a time and still have the datasheet portion usable for the records that have not been locked yet.  Any ideas?
0
Comment
Question by:esbyrt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 84
ID: 39239728
Are you using a SPLIT form, or a form with a Datasheet view?

The SPLIT form is a special type of form available in Access 2010 ... but you can also make your own "split" form by using two subform controls - so we need to know which you're using.
0
 

Author Comment

by:esbyrt
ID: 39242816
It's an actual split form.
0
 
LVL 57
ID: 39256069
<< She would also like to have that line display in a different colour but from what I've been reading that isn't possible in datasheet view like in the split form. >>

  That's correct.  You can do it with a form in continous form view, but then you'll need to do extra work to make it navigate like a datasheet.

<<So, I'm hoping I can at least put in the locking function for one record at a time and still have the datasheet portion usable for the records that have not been locked yet.  Any ideas?>>

  Your going to have a tough time doing anything with a data sheet.

  Before I offer anything, what version of Access are we working with?

Jim.
0
RoboForm Secure Password Management System

RoboForm Everywhere - Superb Browser Support
Windows / Apple / IOS / Android / Linux / Chrome OS
Use different complex passwords everywhere
Best Secure Password Management by far
Synchronize all of your devices instantly
Safe, Secure & Highly Recommended!

 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 39256183
I would try the following: once the record becomes dirty, engage before_update event that will cancel any update, until global variable allows it. Set the global variable by the "unlock" button.
0
 

Author Comment

by:esbyrt
ID: 39258207
jdettman - I am using Access 2010.  

vadimrapp1 - Are you saying once a record is typed into the user would have to click a lock button to save it?  So then if the button wasn't clicked no changes would be saved?  That could work, the big question is then can the user go back and unlock to make changes to the record and then lock again to save changes?  And the bigger question, will that work with a split form?  So the user could click on another line in the datasheet part, type into the record in the top form, click lock and then move on to the next record?

Thanks for having a look!
0
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 500 total points
ID: 39262530
>  Are you saying once a record is typed into the user would have to click a lock button to save it?

No; as soon as the user starts typing, the record will become "dirty" and Access will trigger event "dirty".

The code in that event, sets global variable EditInProgress=True, and enable the button "Unlock" (initially disabled).

The code for the click event of the button will set EditInProgress=False, allowing the update. If you want, you can also place here the code that will actually save the record at this point, so the button "Unlock" will probably become "Save".

Finally, in the event "BeforeUpdate", you place

If EditInProgress then Cancel=true

See the attached sample.
db.mdb
0
 

Author Closing Comment

by:esbyrt
ID: 39300805
I'm so sorry I've let this sit for so long.  Going in too many directions.  This isn't exactly what I was looking for but I can adapt it for my needs.  Thanks so much!
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question