473,511 Members | 15,131 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Locking Records

Hi.
Awhile back I got some useful advice in locking records using tick boxes. Eg
a field called 'Locked' was used to tick (yes/no format) any record in the
datasheet view.
But I would like to know how to do the same when a particular date field
(field name: 'File Date') is populated by the user.
Below is the example of the tick box method...wondering if anyone can modify
the method to my question. thanks.

Set the form's Allow Edits and Allow Deletions properties in the
Form_Current() event procedure.

Private Sub Form_Current()

With Me
.AllowEdits = Not Me.Locked
.AllowDeletions = .AllowEdits
End With

End Sub

Nov 12 '05 #1
2 1596
sonta wrote:
Hi.
Awhile back I got some useful advice in locking records using tick boxes. Eg
a field called 'Locked' was used to tick (yes/no format) any record in the
datasheet view.
But I would like to know how to do the same when a particular date field
(field name: 'File Date') is populated by the user.
Below is the example of the tick box method...wondering if anyone can modify
the method to my question. thanks.

Set the form's Allow Edits and Allow Deletions properties in the
Form_Current() event procedure.

Private Sub Form_Current()

With Me
.AllowEdits = Not Me.Locked
.AllowDeletions = .AllowEdits
End With

End Sub

What are you wanting to check/compare?

Here's a test that allows if date is null
With Me
.AllowEdits = IsNull([File Date])
.AllowDeletions = .AllowEdits
End With

Here's a test that allows if date is eaqual to today
With Me
.AllowEdits = ([File Date] = Date())
.AllowDeletions = .AllowEdits
End With

Nov 12 '05 #2
Hi Sonta,

(aircode)
Private Sub File_Date_AfterUpdate()

If Not IsNull(Me![FileDate]) Then 'Make sure that the user hasn't changed
thier mind

With Me
![Locked] = True 'You'll want to indicate that the record is now
locked.
.AllowEdits = Not Me.Locked
.AllowDeletions = .AllowEdits
End With

End If

End Sub

--
HTH,
Don
=============================
Use My*****@Telus.Net for e-mail
Disclaimer:
Professional PartsPerson
Amateur Database Programmer {:o)

I'm an Access97 user, so all posted code
samples are also Access97- based
unless otherwise noted.

Do Until SinksIn = True
File/Save, <slam fingers in desk drawer>
Loop

================================

"sonta" <sk**@optusnet.com.au> wrote in message
news:40**********************@news.optusnet.com.au ...
Hi.
Awhile back I got some useful advice in locking records using tick boxes. Eg a field called 'Locked' was used to tick (yes/no format) any record in the
datasheet view.
But I would like to know how to do the same when a particular date field
(field name: 'File Date') is populated by the user.
Below is the example of the tick box method...wondering if anyone can modify the method to my question. thanks.

Set the form's Allow Edits and Allow Deletions properties in the
Form_Current() event procedure.

Private Sub Form_Current()

With Me
.AllowEdits = Not Me.Locked
.AllowDeletions = .AllowEdits
End With

End Sub

Nov 12 '05 #3

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

Similar topics

3
5111
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
3476
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...
0
2081
by: brijeshmathew | last post by:
Hi I use Visual Basic 6, Service Pack 6, Microsoft ActiveX Data Objects 2.8 Library(msado15.dll) and access 2000 database using JET 4 OLE. I have an application that adds records simultaneously...
9
2632
by: master | last post by:
Actually, it is not only the record locking, what I need, and nobody seems to descibe this. Imagine the following scenario. There is a database with, say 10000 records with some unvalidated...
1
1262
by: ABrown | last post by:
Hello, I have a 2003 database set up with about 20 users (only about 4 at a time) but I repeatedly get a problem with the records all locking. Each User is assigning billing codes to jobs so they...
0
7237
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,...
0
7417
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7074
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...
0
5659
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,...
0
4734
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...
0
3219
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
445
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...

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.