Snowflake68
Registered User.
- Local time
- Today, 17:45
- Joined
- May 28, 2014
- Messages
- 464
I have built an application using Access inbuilt tabbed navigation forms. I am not able to change the system not to use the built in nav forms now because the system is way too far along for that and very complex.
I have several tabs within my navigation form. The Home tab contains a subform called sfrmDS_Search which displays a list of reference numbers that when clicked take you to the Edit tab to edit the details of that record. It uses the 'BrowseTo' method to navigate to the Edit tab. The Edit tab has some On Load event code that runs when the tab is loaded. However when the Edit tab is first browsed to from the clicking on the ID from the Home first tab, the On Load event code runs twice for some unknown reason. I know this to be happening because I have put a simple pop up message at the start and end of the on load event code just to check my theory. However once the code has ran and the form is presented, if I then click the tab of the Edit tab (which reloads the form) then the code only runs the once which is what it should do. I am only clicking on the Edit tab of the current form just for testing purposes to see if the code run once or twice (the user wouldn't normally click on the Edit tab) but the code only runs the once which is what I what to achieve every time i navigate to the Edit tab from the Home tab.
I am not sure if the code is running twice initially because it is loading inside the container form of the navigation subform or because I am clicking a the Reference number from inside another DS subform but I would like to find a way of always running the code the once only so that it speeds up the loading of the form. There are numerous amounts of controls on the Edit tab and a vast amount of code that needs to run in order to check everything so it can take quite some time to run when the form loads, hence me only wanting it to run the once as it should do.
Is this an error on the Access software itself or am I missing something here.
I have attached a cut down version of the application leaving only the Home and Edit tab and some dummy data. If you click on one of the Reference numbers from the Home tab it will navigate to the Edit tab and you will get the test pop up messages for when the on load even code starts and another one for when it ends. But you will get them twice which confirms the code is running twice. But then once its has loaded click on the Edit tab to reload the form and you will only get the start and end messages the once which is what I want to achieve.
I hope someone can help figure out what is going on and whether there is a way of preventing the code from running twice. because loading the Edit tab is labour intensive due to the numerous amounts of controls and code that needs to run (I have removed all of this in the attached sample database).
Apologies for those that saw my earlier post for the same thing, I unfortunately deleted it by mistake.
I have several tabs within my navigation form. The Home tab contains a subform called sfrmDS_Search which displays a list of reference numbers that when clicked take you to the Edit tab to edit the details of that record. It uses the 'BrowseTo' method to navigate to the Edit tab. The Edit tab has some On Load event code that runs when the tab is loaded. However when the Edit tab is first browsed to from the clicking on the ID from the Home first tab, the On Load event code runs twice for some unknown reason. I know this to be happening because I have put a simple pop up message at the start and end of the on load event code just to check my theory. However once the code has ran and the form is presented, if I then click the tab of the Edit tab (which reloads the form) then the code only runs the once which is what it should do. I am only clicking on the Edit tab of the current form just for testing purposes to see if the code run once or twice (the user wouldn't normally click on the Edit tab) but the code only runs the once which is what I what to achieve every time i navigate to the Edit tab from the Home tab.
I am not sure if the code is running twice initially because it is loading inside the container form of the navigation subform or because I am clicking a the Reference number from inside another DS subform but I would like to find a way of always running the code the once only so that it speeds up the loading of the form. There are numerous amounts of controls on the Edit tab and a vast amount of code that needs to run in order to check everything so it can take quite some time to run when the form loads, hence me only wanting it to run the once as it should do.
Is this an error on the Access software itself or am I missing something here.
I have attached a cut down version of the application leaving only the Home and Edit tab and some dummy data. If you click on one of the Reference numbers from the Home tab it will navigate to the Edit tab and you will get the test pop up messages for when the on load even code starts and another one for when it ends. But you will get them twice which confirms the code is running twice. But then once its has loaded click on the Edit tab to reload the form and you will only get the start and end messages the once which is what I want to achieve.
I hope someone can help figure out what is going on and whether there is a way of preventing the code from running twice. because loading the Edit tab is labour intensive due to the numerous amounts of controls and code that needs to run (I have removed all of this in the attached sample database).
Apologies for those that saw my earlier post for the same thing, I unfortunately deleted it by mistake.
Attachments
Last edited: