locking field after 24hrs

stu_c

Registered User.
Local time
Today, 08:10
Joined
Sep 20, 2007
Messages
494
how do I lock a field after 24hrs so it cannot be changed?
I am using modules

If [Forms]![FRM_TBLALL_FullCustomerDetails]![Form]![DateEntered] < Now - 1 / 24

but doesn't seem to work?
 
how do I lock a field after 24hrs so it cannot be changed?
I am using modules

If [Forms]![FRM_TBLALL_FullCustomerDetails]![Form]![DateEntered] < Now - 1 / 24

but doesn't seem to work?
Try:
If [Forms]![FRM_TBLALL_FullCustomerDetails]![Form]![DateEntered] < Now - 1
 
I tried that is didn't seem to work
 
I have never used Now with out ()?
However it appears to work?
Code:
? now - 1
19/05/2022 14:01:13
I would put Now -1 within brackets though?

Now just tested as offered, and works fine?, so no clue why it does not work for you. :(
Code:
Private Sub Cbosheets_GotFocus()
If Me.cboSheets < Now - 1 Then
    MsgBox "Past 24 hours"
End If
End Sub

Walk through your code. :(
 
I tried that is didn't seem to work
Where are you using the code?
What exactly does "it doesn't work" mean? Does it throw an error? Have you checked that the code fires?
 

Users who are viewing this thread

Back
Top Bottom