Sorry, I need to add some more information because my post isn't accurate
enough to give an answer:
I know I can do this:
DoCmd.RunCommand acCmdDeleteRecord
Which I've done, but here's the problem.
I have a form called Picture which displays data from a table of the same
name. However, almost all of the work done is independent of the Access form
binding.
The table Picture has the following fields:
PictureID - Autonumber
PropertyDetailsID - Number
PictureNumber - Number
PictureData - Ole Object
The Picture form is passed a PropertyDetails ID as an argument when it is
opened.
I have a picture number combo that allows you to select a number from 1-4.
There is an Add/Replace picture button which loads a picture from a file and
places it in the Picture Data field.
Where I run into problems is that I have a Delete Picture button. Using ADO,
it deletes the record from the database.
When one tries to close the Picture form after deleting a picture, there's
an error because the PropertyDetailsID field is null (which isn't allowed by
the DB).
Basically, I want Access to ignore the fact that there's a current record so
that when I close the Picture form, I don't get the error message.
Despite the error message, everything works as it's supposed to and
supressing the error message is sufficient for my needs, if that's possible.
Anyone have any ideas?
Pete