First, a bit about the data:
Each record has a unique key (autonumber), and an ItemID (text) that is not necissarily unique nor required, as well as various item information. It is possible that an item with the same ItemID may come through the system to be reprocessed. This would mean either a new record with a new key and same ItemID, or update an existing record using the same key and ItemID. Both are possibilities.
Next, the data entry form:
The ItemID has a BeforeUpdate event which checks for existing records with the same ItemID. If matching records are found, a pop-up form allows you to select one of the existing records to edit. Afer a record is selected, it returns to the data entry form and moves to the desired record for editing.
The problem:
Suppose someone begins entering data in the form and enters the ItemId after half completing the form. The ItemID matches existing records and they choose to edit an existing record instead of create a new one. The data entry form moves to the selected record, however the half entered record from the beginning is saved.
Is there a way to discard the previously entered data before moving records?
Currently I have a DoCmd.MenuItem to delete the previous record, but then a nag message comes up asking if I am sure I want to delete the record. Is there a way to silently delete the record?
Each record has a unique key (autonumber), and an ItemID (text) that is not necissarily unique nor required, as well as various item information. It is possible that an item with the same ItemID may come through the system to be reprocessed. This would mean either a new record with a new key and same ItemID, or update an existing record using the same key and ItemID. Both are possibilities.
Next, the data entry form:
The ItemID has a BeforeUpdate event which checks for existing records with the same ItemID. If matching records are found, a pop-up form allows you to select one of the existing records to edit. Afer a record is selected, it returns to the data entry form and moves to the desired record for editing.
The problem:
Suppose someone begins entering data in the form and enters the ItemId after half completing the form. The ItemID matches existing records and they choose to edit an existing record instead of create a new one. The data entry form moves to the selected record, however the half entered record from the beginning is saved.
Is there a way to discard the previously entered data before moving records?
Currently I have a DoCmd.MenuItem to delete the previous record, but then a nag message comes up asking if I am sure I want to delete the record. Is there a way to silently delete the record?