Normal Topic Subform focus on TabPage (Read 771 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Subform focus on TabPage
Dec 16th, 2013 at 10:34pm
Print Post Print Post  
I have a subform named Scripts1 on a TabPage. It is the placed at the top and it did take the focus after using tab key twice in version 2.5.2 as expected and executed the form Entry command as mentioned under.

After installing version 2.5.3, after using two tabs the form entry command is not executed, however the programming in the first element of the subform on element exit event is executed!! Obviously the first record in the subform has taken the focus but not executing the form entry command. The sure way to make this command executed is to double click the first record. Execution of the On form Enter commands are working fine for the 2nd records onwards. It is only the record number 1 exhibiting this behavior.

I guess, it is my expectation of first record of the subform taking focus and executing on form Enter commands on hitting tab key twice is not working.

On form Entry Event of Scripts1 (subform)
Code
Select All
var vFormMode as int

If @standalone ( ) = 0 or vFormMode = FORM_VIEW_TYPE_Table then
	{
		WarningLevel (0)
		Visibility (U, 0)
		Visibility (RecNumber, 0)
		Visibility (Date1, 0)
		Visibility (MCode, 0)

		WarningLevel (0)
		ThrowFocus (Medicine)


	}
	Else if @Standalone ( ) = 1 then
	{
		Visibility (U, 1)
		Visibility (RecNumber, 1)
		Visibility (Date1, 1)
		Visibility (MCode, 1)
	}

vFormMode = @FormViewType("Scripts1" )
	if(vFormMode = FORM_VIEW_TYPE_FORM)
	{
		Visibility (Note, 1)
	}
	else if vFormMode = FORM_VIEW_TYPE_Table
	{
		Visibility (Note, 0)
	}

ForceRedraw ( )

 



Can someone suggest any work around and changing the code to make it work without using the mouse?

7 out of 10 times I have to delete the first record and since the warninglevel (0) is not executed, it throws the warning message that I want to avoid.
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Subform focus on TabPage
Reply #1 - Dec 17th, 2013 at 3:09pm
Print Post Print Post  
Hello Bharat,

Since you're changing Visibility based on @Standalone() I would recommend doing it in Global Code instead of Form Entry. This way it only runs once when the form opens and not every time you step through a record. Only thing you should have to change is the Var to Stat and remove the Throwfocus() call.

Code
Select All
Stat vFormMode as Int

vFormMode = @FormViewType("Scripts1" )
If @standalone ( ) = 0 or vFormMode = FORM_VIEW_TYPE_Table then
	{
		WarningLevel (0)
		Visibility (U, 0)
		Visibility (RecNumber, 0)
		Visibility (Date1, 0)
		Visibility (MCode, 0)

		WarningLevel (0)
	}
	Else if @Standalone ( ) = 1 then
	{
		Visibility (U, 1)
		Visibility (RecNumber, 1)
		Visibility (Date1, 1)
		Visibility (MCode, 1)
	}

	if(vFormMode = FORM_VIEW_TYPE_FORM)
	{
		Visibility (Note, 1)
	}
	else if vFormMode = FORM_VIEW_TYPE_Table
	{
		Visibility (Note, 0)
	}
 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Subform focus on TabPage
Reply #2 - Dec 19th, 2013 at 10:22pm
Print Post Print Post  
Hi Ray,
Thanks for your input. As per your suggestion I placed the code in Global Area and visibility part of the code works fine but WarningLevel ( ) does not work as I have to work through the other tabpages first before I come to the tabpage with the subform and Global code compiled when I entered the parent form. It is only the first record of the subform that throws the warning while deleting the first record. Still I believe, form entry code of subform record is not executing eventhough the focus is taken by the first record of the subform. There was no such issue with version 2.5.2.
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Subform focus on TabPage
Reply #3 - Dec 20th, 2013 at 8:19pm
Print Post Print Post  
Hello Bharat,

I am seeing that there is a difference between 2.5.2 and 2.5.3, I'll pass it on to development and see what we can do to get that fixed for you.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Subform focus on TabPage
Reply #4 - Dec 20th, 2013 at 8:28pm
Print Post Print Post  
Thanks Ray. We can depend on you as always!!
  
Back to top
 
IP Logged