S stu_c Registered User. Local time Today, 18:04 Joined Sep 20, 2007 Messages 494 May 20, 2022 #1 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?
bob fitz AWF VIP Local time Today, 18:04 Joined May 23, 2011 Messages 4,809 May 20, 2022 #2 stu_c said: 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? Click to expand... Try: If [Forms]![FRM_TBLALL_FullCustomerDetails]![Form]![DateEntered] < Now - 1
stu_c said: 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? Click to expand... Try: If [Forms]![FRM_TBLALL_FullCustomerDetails]![Form]![DateEntered] < Now - 1
S stu_c Registered User. Local time Today, 18:04 Joined Sep 20, 2007 Messages 494 May 20, 2022 #3 I tried that is didn't seem to work
Gasman Enthusiastic Amateur Local time Today, 18:04 Joined Sep 21, 2011 Messages 17,478 May 20, 2022 #4 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 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.
bob fitz AWF VIP Local time Today, 18:04 Joined May 23, 2011 Messages 4,809 May 20, 2022 #5 stu_c said: I tried that is didn't seem to work Click to expand... 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?
stu_c said: I tried that is didn't seem to work Click to expand... 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?