By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,651 Members | 1,908 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,651 IT Pros & Developers. It's quick & easy.

Record is deleted error when requiring a related sub-form, how to handle?

100+
P: 176
Hello.

I have a form with 2 sub-forms in it. One is sfrmFormulations, other is sfrmCategories. Logically, tblFormulations and tblCategories related on one-to-many basis and have delete and update cascade. In the form, they are kept related by on current event in sfrmFormulations, which activates a requery in sfrmCategories.

When I delete a record in sfrmFormulations, I get the following error:
Run-time error '3167'
Record is deleted.

Pressing the debug button, Access takes me to Form_Current sub, to the line:
Expand|Select|Wrap|Line Numbers
  1. Me.Parent.sfrmCategories.Form.Requery
I need some help on how can I handle properly such an event.
Apr 28 '08 #1
Share this Question
Share on Google+
2 Replies


nico5038
Expert 2.5K+
P: 3,072
Check:
http://kbalertz.com/135379/Records-A...-Reopened.aspx
for some detailed information.

Nic;o)
May 18 '08 #2

P: 2
I can only take a guess at the cause of the error as you have not listed any code that opens the query or explained in which event this is supposed to happen.To resolve this when you open the access table by using Visual Basic code, include the dbSeeChanges option, as in the following example:

Set rs = db.OpenRecordset("TestTable", dbOpenDynaset, dbSeeChanges)


The dbSeeChanges option ensures that any newly added records that contain a default value in the unique index field are available in the current recordset.

If still you get error that means there is corruption in database so you must import your database to new blank one or use stellar phoenix access repair software to repair your database.

Hope it helps
May 30 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.