memory of past record

  • Thread starter Thread starter tony wong
  • Start date Start date
T

tony wong

i have the following code running. The 1st part (assignee) seems fine but
there may be problem with 2nd part(status)

when i search for record A, the code seems running fine (status = not
closed, allow me to edit, add & delete)
then i page down to a record B, the code seems running fine too (status =
closed, not allow me to edit, add & delete)
then i page up back to record A, the form goes wrong, (status = not closed,
NOT allow me to edit, add & delete)

What i miss in the code, thanks a lot for your help and anyone assisted me
before.

Tony


*************************************

If Forms!FrmApplicant!FrmOfficer!assignee <> assignperson Then
Me.AllowEdits = False
Me.AllowDeletions = False
Me.AllowAdditions = False

ElseIf Forms!FrmApplicant!Status = "Closed" Then
Me.AllowEdits = False
Me.AllowDeletions = False
Me.AllowAdditions = False

Else
Me.AllowEdits = True
Me.AllowDeletions = True
Me.AllowAdditions = True
End If
 
This is the full codes.

*************************************
Private Sub Form_Current()

Dim assignperson As String
assignperson = CurrentUser()

If FrmOfficer!assignee <> assignperson Then
Me.AllowEdits = False
Me.AllowDeletions = False

ElseIf Status = "Closed" Then
Me.AllowEdits = False
Me.AllowDeletions = False

ElseIf Status = "Cancelled" Then
Me.AllowEdits = False
Me.AllowDeletions = False

Else
Me.AllowEdits = True
Me.AllowDeletions = True
End If

End Sub
 
Back
Top