Prev | Current Page 920 | Next

Michael R. Groh, Joseph C. Stockman, Gavin Powell, and Cary N. Prague

"Access 2007 Bible"

If it is open, the statement to close it executes. Although
attempting to close a form that is not currently open does not cause an error, always check to see if
an object is available before performing an operation on it (doing so is just good form).
433
Understanding the Access Event Model 12
Using an event procedure to
confirm record deletion
Although you can use the Access Form View ribbon to delete a record in a form, a better practice is
to provide a Delete command button on the form. A Delete button is a more user-friendly method
because it provides a more obvious visual cue to the user as to how to delete a record. Additionally,
the command button affords more control over the delete process because you can include code
to verify the deletion before it is actually processed. Or you may need to perform a referential
integrity check to ensure that deleting the record does not cause a connection to the record from
some other table in the database to be lost.
Use the MsgBox() function to confirm a deletion.


Pages:
908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932
Noclegi w Stegnie alles klar 1b sprawdziany Sennik del.icious.pl ławki betonowe