Do not delete specific records

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
 
S

Stuart McCall

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
 

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