microsoft access help database programing developer
software solutions PC Experts Home Page software solutions Software Experience application development Website Development datbase experts solutions Our Team of Programmers programming consulting help Development Services pocket pc consulting solutions Application Case Studies sql server microsoft Expert Tips Newsletter website design and hosting Contact our Team pocket pc programming
 
 
Access Help: BeforeDelConfirm Event Displays no Data
by Juan Soto
06/03/2006

When using this event you will lose access to your data.

Access Programming Tip
Sometimes you may need to confirm deletion of a record with a user before allowing them to delete the record. The BeforeDelConfirm event will allow you to cancel the deletion if necessary. But one problem with this event is the lack of access to your data, therefore using form data is out of the question. To avoid the situation, use the Delete event on the form.

Delete Event Does Allow Access To Data
I had built a check register program for a client and one of the requirements was to prevent checks that were voided from being deleted. My program would look at the check number and if the word "Void" was in it, then prevent deletion of the database record. I used the Delete event and would set Cancel = True. Below is the code fragment I used:

        If Me.CheckNumber = "Void" Then
            Cancel = True
            Me.Undo
            MsgBox "Voided checks cannot be modified.", vbInformation, "Can't Change Check"
            Exit Sub
        End If


If you like this tip you will be delighted with our service! Call or write us today for a free quote regarding your computer needs.

Publish this article in your own corporate newsletter or publication! Contact us to obtain a free license.


Home | About Us Why PCExperts | Team | Services | Newsletter | Contact Us
Copyright © 2004