Question Subform event occasionally not firing (1 Viewer)

Janhal

New member
Local time
Today, 21:45
Joined
Mar 23, 2019
Messages
2
Hi, another question about subform event not firing as expected.
Using Access 2013.
I have a dialog type main form with 2 subforms, each with a datasheet with one-to-many relation from the main form (one record for editing). Main and subforms are at one tab each.
My problem is that when rightclicking left of the first column in subform, taking ”Delete record” from the built-in shortcut, the Delete event is sometimes not firing. This happens mostly when form opens but might get to right behaviour later when navigating in the form (no design changes in between). Both subforms act right/wrong simultaniously.
My observation is that the delete confirm dialog looks different with/without executed delete event. When event was executed the dialog shows info how many records that are to de deleted. Without event it only says ” ..one ore more..” ( my translation to english).
Since there are no code between shortcut menu action and the delete event I suppose some kind of internal status is different at times.
Anyone experienced similar problems? Thanks!
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 12:45
Joined
Oct 29, 2018
Messages
21,467
Hi. It might help understand better what you're experiencing if you're able to post a screenshot the different messages you're getting.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 14:45
Joined
Feb 28, 2001
Messages
27,172
I have to ask whether you get ANY messages at all since it sounds like the messages you are seeing are not actually Access messages. Is your "delete confirm" dialog one that you generated?

This is what Microsoft says about that class of events:

https://docs.microsoft.com/en-us/office/vba/api/access.form.delete

In particular, in the note in the middle of the article, there is a discussion of cases when the events will not occur. Take a look.
 

Janhal

New member
Local time
Today, 21:45
Joined
Mar 23, 2019
Messages
2
Thanks for answering!
Yes, sorry for that. The problem is that
I’m on a swedish Access not knowing the exact english dialog texts.
The confirm dialogs are Access-stuff. When Delete event is fired the dialog shows how many records that are to be deleted. When Delete event is skipped dialog only says ”..one or more records...”.
Anyway todays work in testing this and that got me to get rid of the problem.
Form is opened with DoCmd passing acDialog to get it modal.
Instead setting the form properties ’Menu form’ =yes and ’Modal’ =yes and skipping acDialog in DoCmd makes the Delete event to be fired always.
Although it is confusing not understanding why, the db now works stable as expected in this part.
Appreciate your given input!
Thanks.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:45
Joined
Oct 29, 2018
Messages
21,467
Hi. Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom