Re: prevent deletion of record



Yes, you can add lots of stuff to a procedure. This one
line is quite independent of most things so it should not
intefere with any thing else. The one exception would be if
your delete button has the focus, in which case you would
need to set the focus to some other control before disabling
the button.
--
Marsh
MVP [MS Access]


Sue wrote:
>I already have an Event Procedure controling the change of another field in
>the On Current property. Can i add another line to that On Current Event
>Procedure?
>
>
>> Sue wrote:
>> >I have a form that displays previous year's info at top w/ space to enter new
>> >info current year info at bottom. I would like to prevent the deletion of
>> >the record if there is a value greater than '0' in the previous yr value.
>> >There is a deletion button on the form.
>>
>"Marshall Barton" wrote:
>> I think I would disable the delete button if the prev yr
>> field >0 using the form's Current event:
>>
>> Me.btnDelete.Enabled = (Me.[previous yr] > 0)
.


Quantcast