Do not delete specific records

  • Thread starter Thread starter D
  • Start date Start date
D

D

Hi:

I have this code for not editing these records; can you please tell me how I
can prevent the deletion of those records??

Private Sub Form_Current()

If Me!RecType = "fy08a" Then
Me.AllowEdits = False
MsgBox ("FY08 Actuals; this record is read only. Please click OK and
navigate to the next record")

ElseIf Me!RecType = "fy09b" Then
Me.AllowEdits = False
MsgBox ("FY09B Budget; this record is read only. Please click OK and
navigate to the next record")

Else
Me.AllowEdits = True
End If
End Sub

Thank you,

Dan
 
D said:
Hi:

I have this code for not editing these records; can you please tell me how
I
can prevent the deletion of those records??

Private Sub Form_Current()

If Me!RecType = "fy08a" Then
Me.AllowEdits = False
MsgBox ("FY08 Actuals; this record is read only. Please click OK and
navigate to the next record")

ElseIf Me!RecType = "fy09b" Then
Me.AllowEdits = False
MsgBox ("FY09B Budget; this record is read only. Please click OK and
navigate to the next record")

Else
Me.AllowEdits = True
End If
End Sub

Thank you,

Dan

Me.AllowDeletions = False

Use it alongside your Me.AllowEdits = False
 
Back
Top