HillTJ
To train a dog, first know more than the dog..
- Local time
- Today, 01:22
- Joined
- Apr 1, 2019
- Messages
- 731
People, I have a main Navigation Form called "Main_Menu" (I couldn't think of a better name), I use the onclick event of a button to open the next form. At That Event I also assign 'TempVars!PreviousForm="Main_Menu", then go on to open form 'CompaniesFRM' . Conversely, on 'CompaniesFrm' I have a button that opens 'TempVars!PreviousForm (which may be = Main_Menu, or not depending upon from where It's been initiated) and close 'CompaniesFRM'. The reason I do this is that depending upon which form I have come from dictates the controls that are visible on the form to be opened (Maybe for instance, it's a single form as a result of a hyperlink where I don't want to display nav buttons).
This seems to work well in most cases, except I have a bound subform on 'CompaniesFRM'. If opened from the 'Main_Menu' option button, I do not wish to display the Close Button on that subform. I thought I'd assign TempVars!PreviousForm = "CompaniesFRM" during the onload event of 'CompaniesFRM', then check the value of TempVars!PreviousForm in the onload event of the subform & if ="CompaniesFRM", then hide the close button.
However, it appears that when I open 'CompaniesFRM' that the value is not passed to the subform, in fact when adding debug.print It always displays 'Main_Menu'. I thought that the onLoad event of 'CompaniesFRM' would assign the said value. It seems that upon opening the 'CompaniesFRM' the subform 'OnLoad event' precedes the Parent form Onload Event. So the subform never sees the TempVars!PreviousForm = "CompaniesFRM" , but rather still sees 'TempVars!PreviousForm="Main_Menu". To test this, I've temporarily changed the value of 'TempVars!PreviousForm to ='CompaniesFRM' in the onload event of the subform & all works properly.
I've explained this to the best of my ability, It's difficult to put into words. I hope I've made at least some sense.
This seems to work well in most cases, except I have a bound subform on 'CompaniesFRM'. If opened from the 'Main_Menu' option button, I do not wish to display the Close Button on that subform. I thought I'd assign TempVars!PreviousForm = "CompaniesFRM" during the onload event of 'CompaniesFRM', then check the value of TempVars!PreviousForm in the onload event of the subform & if ="CompaniesFRM", then hide the close button.
However, it appears that when I open 'CompaniesFRM' that the value is not passed to the subform, in fact when adding debug.print It always displays 'Main_Menu'. I thought that the onLoad event of 'CompaniesFRM' would assign the said value. It seems that upon opening the 'CompaniesFRM' the subform 'OnLoad event' precedes the Parent form Onload Event. So the subform never sees the TempVars!PreviousForm = "CompaniesFRM" , but rather still sees 'TempVars!PreviousForm="Main_Menu". To test this, I've temporarily changed the value of 'TempVars!PreviousForm to ='CompaniesFRM' in the onload event of the subform & all works properly.
I've explained this to the best of my ability, It's difficult to put into words. I hope I've made at least some sense.