Time lock on records

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

--
Is it possible to put a time lock on records, say 6 months prior to computer
clock, So records can not be altered any further back than 6
Months.............Any Help Thanks.....Bob






..........Jenny Vance
 
Bob said:
--
Is it possible to put a time lock on records, say 6 months prior to
computer clock, So records can not be altered any further back than 6
Months.............Any Help Thanks.....Bob






.........Jenny Vance
My Records do have a date field [BillDate] that gives a date of payment with
the record!
Regards......Bob
 
Actually I have a lock on my invoices but it is not working it is meant to
lock 12 month old records but it does not, If you are in Jan07 it lockes
everthing back from Dec06, seems to me its just going back on the year adte
and not the 12 months, Here is part of my code:

'If the difference between InvoiceDate and currentDate
'is greater than one or more years then lock all controls
'of the forms therefore you can't edit or delete
'that old Invoice.
Dim dDate As Date
Dim dtDiff
Dim nCountDaysOfYear As Long
Dim nLeapYearNow As Long, nLeapYearOfBillYear As Long
Dim nTotalDays As Long
dDate = Form_frmModify.lstModify.Column(3)
'11 May 2006, Dnyanada Varude.
'Fixed the error of Date difference.
dtDiff = DateDiff("d", Format(dDate, "mm/dd/yyyy"),
Format(Now(), "mm/dd/yyyy"))
'11 May 2006, Dnyanada Varude.
'Fixed the error of Date difference.
nLeapYearOfBillYear = DatePart("yyyy", Format(dDate,
"dd/mm/yyyy"))
nLeapYearOfBillYear = nLeapYearOfBillYear Mod 4

nLeapYearNow = DatePart("yyyy", Format(Now(), "dd/mm/yyyy"))
nLeapYearNow = nLeapYearNow Mod 4

If nLeapYearNow = 0 Or nLeapYearOfBillYear = 0 Then
nTotalDays = 366
Else
nTotalDays = 365
End If

If dtDiff > nTotalDays Then
cmdClose.SetFocus
subLockControls False, True
bLockFlag = True
Else
subLockControls True, False
End If
 
If you're viewing the records one at a time, you could put some logic
in the Current event of your form that toggles the .AllowEdits
property of the form. Something like

Me.AllowEdits = (DateDiff("d",me.Fields("SomeDate"),Date())>180)

then the locking should be automatic. Problem is, you can't lock the
data at table level really.

Not pretty, but it should work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top