Here's the code. I'm trying to test for 2 separte items in order to allow
edits, elaplsed time <5min and that the person who created the record is the
[quoted text clipped - 34 lines]
What? That code won't even compile so it doesn't matter
what the test does not do. You can help yourself avoid
extraneous Else statements if you indent the code between
block type statement such as If - Else - End If, With - End
With, For - Next, Do - Loop, etc.
Here's my attemp to clean it up. Be sure to Compile it (and
fix any compile errors) before attempting to test it.
Private Sub Form_Current()
On Error GoTo Form_Current_Error
If Me.NewRecord _
OR (CurrentUser = Me.txtCreator _
AND DateDiff("n", Me.fldTimeStamp, Now) <= 5) Then
Me.AllowEdits = True
Else
Me.AllowEdits = False
MsgBox "You are not the author . . ."
End If
AllDone:
Exit Sub
Form_Current_Error:
On Error Resume Next
MsgBox "Error " & Err.Number & " -" & Err.Description _
& vbCrLf & " in Form_Current of Form_fsubRNnotes"
Resume AllDone
End Sub