memory of past record

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
 
T

tony wong

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
 

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

Top