allow deletions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I have a continuous subform. One of the fields is chkbox. When the
chkbox=Yes, I would like the AllowDeletions = No, for that row. If in the
next row the chkbox=No, than I would like the AllowDeletions = Yes.
The AllowDeletions default is Yes.

My code in the frmContinuousSubForm is as follows:

Sub Form_Current()
If me.chkbox = Yes Then
Forms!frmMain!frmContinuousSubform.Form.AllowDeletions = No
Else
Forms!frmMain!frmContinuousSubform.Form.AllowDeletions = Yes
End If
End Sub

The results have been unpredictable. At one time I would get the exact
opposite of what I wanted. I was able to delete the records where
chkbox=Yes. I reread code to make sure I did not inverse my yes/no criteria
but it looked correct.
Thanks for the help.
Charlie
 
AllowDeletions is at the form level, not the row level. Since you have this
code in the current event, the value will dictate whether the form will allow
or deny deletes for all records, not the current one.
 
Klatuu,
Thank you for the response. I don't write code often but I thought that the
On Current property was for the current record of the form. Is there a way
to prevent deleting an individual record in a continuous form?
Carla
 
Back
Top