Solved Just a curious question.. (1 Viewer)

mloucel

Member
Local time
Today, 13:29
Joined
Aug 5, 2020
Messages
210
What event starts when you right click on a form to choose design view, nothing important, just out of curiosity.

I've tried on close and on unload events but I cannot check that, is nothing of life and death, nothing and End User will ever do or use.

Is simply the curiosity of someone is learning..

Thanks.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 15:29
Joined
Feb 28, 2001
Messages
27,604
In design view, I don't recall that ANY standard Access form event is triggered that would be visible to (or care about) your VBA code. When that form opens in design mode, you will see its controls, which implies a type of Form_Open, but to a view that doesn't show controls as they would normally appear in Form view. So that would be a non-normal Form_Open activity. No data gets loaded, and so far as I remember, if that form WOULD be bound to a record, that recordset is not opened. So no _Current events get triggered.

After a couple of searches, I determined a consensus that if another form is open with a timer that you can have certain kinds of interference that mostly depend on exactly what the timer is doing and whether it even cares about the form you just opened. There can also be something called a "callback" from the ribbon code if you have a customized ribbon that HAD some hidden code. Again, that would depend on the hidden code as to what would happen.

In summary, for a simple Access form opened in design mode, NO events fire.

Now, IF you had the form already open in Form mode and switched it to Design mode, there is a moment where the Form mode form would fire its normal shutdown events, the _Unload and _Close of that previously open form.
 

mloucel

Member
Local time
Today, 13:29
Joined
Aug 5, 2020
Messages
210
In design view, I don't recall that ANY standard Access form event is triggered that would be visible to (or care about) your VBA code. When that form opens in design mode, you will see its controls, which implies a type of Form_Open, but to a view that doesn't show controls as they would normally appear in Form view. So that would be a non-normal Form_Open activity. No data gets loaded, and so far as I remember, if that form WOULD be bound to a record, that recordset is not opened. So no _Current events get triggered.

After a couple of searches, I determined a consensus that if another form is open with a timer that you can have certain kinds of interference that mostly depend on exactly what the timer is doing and whether it even cares about the form you just opened. There can also be something called a "callback" from the ribbon code if you have a customized ribbon that HAD some hidden code. Again, that would depend on the hidden code as to what would happen.

In summary, for a simple Access form opened in design mode, NO events fire.

Now, IF you had the form already open in Form mode and switched it to Design mode, there is a moment where the Form mode form would fire its normal shutdown events, the _Unload and _Close of that previously open form.
Thanks Doc, it was just simply curiosity, no code involved, no weird things in my program, but just for the sake of argument..

I am working on a bounded form, some data will be pre-filled for the end user, all is ok with the form, no issues, is just that when I am testing for one thing or another everytime I right click and go to design view, I get the message:
"You cannot add or change a record because a related record is required in table "XXXXX" "
which is correct if I just open the form just to see how it looks [ Enforce Ref Integ. ]
then: "you can't save this record..". bla, bla, bla, which amounts to nothing because the record won't be saved anyway, and is ok, is supposed to be like that, so no worries so far, everything is working as it should be.

But again thanks doc, one less doubt in my head.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 16:29
Joined
Feb 19, 2002
Messages
43,883
If the form is dirty, the BeforeUpdate event will run. Otherwise the Close event

If you want to examine how form events work, you might want to take a look at this example database I built for the video mentioned in the thread. I suggest watching at least one video so you can see how the form works. The one hosted on Utube is the most entertaining due to the audience interaction.

 

mloucel

Member
Local time
Today, 13:29
Joined
Aug 5, 2020
Messages
210
If the form is dirty, the BeforeUpdate event will run. Otherwise the Close event

If you want to examine how form events work, you might want to take a look at this example database I built for the video mentioned in the thread. I suggest watching at least one video so you can see how the form works. The one hosted on Utube is the most entertaining due to the audience interaction.

Holly Jesus Pat, this is GENIUS,
First of all, I had 1000% Respect for your knowledge and patience with my donkey[ness] ;) but now is up to infinity, I am actually learning from the very very very beginning access, of course I am doubling down with VBA because of timing issues, but this has been the best explanation ever on those events, actually I applied it to the forms I am using and voila no more issues at closing.
I know and fully understand that my database and coding will make me the clown in the forum, but like you said, everybody starts somewhere, I think in a few years I will go back to my actual program and think..
What a fool
but I will be a fool once.

@Pat Hartman I whish I can learn more from you, I am extremely thankful, and please apologize me before hand for all the stupid questions I will ask, for many here in the forum will think what the heck am i doing, but no one knows my situation and my lack of knowledge, I am trying at 60 to learn and old skill I had with some new programming language I've never used, as you know I was good with FoxBase and Cobol, but that was 40 years ago, this is so new to me, and I am still trying to apply those techniques I used with this new monster called ACCESS and VBA, so is not easy.

I am looking forward part 2 of the video, or video series.

never the less if you have a website or maybe a learning place you handle I would love to learn from you as well.

Thanks for your lessons.

Maurice.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 16:29
Joined
Feb 19, 2002
Messages
43,883
Thank you for your kind words. I'm glad you are enjoying the videos. Tony and I had a lot of fun making #1 and #2. The database which I started just to show the events as they fired became the star of the show. I've never seen a better tool for showing how forms actually work. I found stuff that surprised me when I looked at the list of events that ran. Once you get a feel for how the form works, you can add code to play with control level events. I did some of that in #2 to show specifically how putting code in the Lost Focus and on Exit events did NOT keep bad data from being saved no matter how many times you display an error message. It was a "discussion" on the forum with another expert who insisted that using these events was a valid way to keep bad data from being saved that convinced me to try to make an example.
 

Users who are viewing this thread

Top Bottom