3167 record is deleted (1 Viewer)

philfer

Registered User.
Local time
Today, 15:22
Joined
Dec 15, 2008
Messages
29
Hello,

I have a form with a subform on it

On the subform I have a button which I can add a record

The added record appears with a button (which is on the subform) that allows the user to delete it.

Everything works well unless the user is on one of the controls of the record to be deleted. Then I get the above error.

I have tried to move the focus away from the record but cant get it to delete without this error

I first tried to move the focus to the "add" button of the subform but get the same error

I then try to move focus to a control on the main form.

This works fine unless the user is in a control in the subform record to be deleted in which case I get a 2110 cant move forcus to the control error.

The thing that is causing me these problems is if the user is in a control on the record in the subform that is to be deleted

Is use DoCmd.RunSQL "DELETE * ....." to do the delete but have tried it using a saved query and get the same problem....again only if the user is in a control on the subform record to be deleted

Its driving me crazy!!

Any help
P
 

vbaInet

AWF VIP
Local time
Today, 23:22
Joined
Jan 22, 2010
Messages
26,374
philfer, so what is the problem here? After deleting a record it's display "# Deleted"?
 

philfer

Registered User.
Local time
Today, 15:22
Joined
Dec 15, 2008
Messages
29
Hi,

Yes thats correct. but this happens only if the user is in the record. Otherwise when the delete runs the records simply disappears and the form is clean. This is a more elegant and professional look rather than the #deleted return.

There must be a way to make the form work cleanly in both circumstances as the users are quite basic users and will think there is an error when this happens and phone me!!!

Cheers
Phil
 

vbaInet

AWF VIP
Local time
Today, 23:22
Joined
Jan 22, 2010
Messages
26,374
I will need to see your setup and see the problem in action. Can you upload a sample db with only the relevant bits in it? I only need test data so don't upload anything confidential.

Also tell precisely how to reproduce the problem on the sample db and ensure you can reproduce it on the same sample db too (before uploading).
 

Users who are viewing this thread

Top Bottom