Free Lessons
Fast Tips
Topic Index
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
Home > Courses > Access > Templates > Record Locks
Back to Access Record Locks Template    Comments List
Is null still problem Upload Images   Link   Email  
Thomas Gonder       
2 years ago
I downloaded the Record Locks template just yesterday.
I tried to add a new Customer.
The VBA code aborted.
I assume it's the same problem as the Product new record.
Can we fix the template to work properly?
Adam Schwanz             
2 years ago
Rick should update the template if it's still downloading erroring, did adding the line of code not fix it for you though?
Thomas Gonder       
2 years ago
No, it's crashing in multiple procedures for a new customer.
I assume it will have the same problem when adding new in all the other tables.
Kevin Robertson            
2 years ago
In the procedures that generate the error check the ID field for Null.

If IsNull(CustomerID) Then Exit Sub
Thomas Gonder       
2 years ago
I'm not sure if that's what's needed for new records.
Once the ID is known, should new records show as locked too?
This is somewhat tied to the problem of Access (stupidly I think) assigning an ID before a new record is actually updated.
Kevin Robertson            
2 years ago
Why would new records need to be locked? They haven't been saved to the table yet so there is no possibility of someone else editing them.
Thomas Gonder       
2 years ago
So a query doesn't start running until after the record is saved?
Isn't that part of all this?
Richard Rost             
2 years ago
Walk me thru step by step what's happening.
Adam Schwanz             
2 years ago

Adam Schwanz             
2 years ago
Richard when you use navigation bar to go to new record and try to type, just needs to check if it's a new record exit sub
Thomas Gonder       
2 years ago
You have to do it in at least two places for each form in the template.
The timer code get's an error too.
Then you have to think well, how do I want to handle new records and locking?
If we are stopping queries from running, then we need to do it here too for all the same reasons we're doing it in already exiting records.
Then there's the opposite of locking records. Maybe if we are about to run an update query, we want to set-record locking so that no updates can happen in forms at the same time? So, we aren't locking one record, rather the whole table(s) that then forms can see as every record is locked.
Adam Schwanz             
2 years ago
There's no reason you would need to lock a record that is new, nobody else would even be able to access that record until it had been saved. Likewise there would be no effect on queries during the "New record" state. You could try to dlookup it even but if it doesn't exist as a saved record in the table, it won't find it. Likewise if you try to run an update query that includes it, it wouldn't do anything to that record until it had been saved at least once to write the record.
Thomas Gonder       
2 years ago
@ Adam, there are situations where I think you wouldn't want the new record to write to the table while an update query supposedly has the table locked. Once we get the problem with null IDs fixed, then we can test if the new record is prohibited from going dirty like the existing records.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Record Locks Template.


The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.

Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
My Account
My Courses
Lost Password
Student Databases
Change Email
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Customer Support
Web Site Tour
Consulting Services
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Video Tutorials
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Terms of Sale
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 7/19/2024 7:21:28 AM. PLT: 1s