cancel
Showing results for 
Search instead for 
Did you mean: 

is there any other way to focus my control when my form mode changes state

Former Member
0 Kudos

hi...

i have written the following code in my item event.....

the purpose of this is...when my form changes to add mode...i want the cursor to be placed in my first control(i.e TextBox)

here my when i place this code in item event....my menu events are not working at all...and my item events are alos not working

is there any other way to focus my control when my form mode changes to any other mode.....

If (pVal.FormUID = "Form502") And (oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE) Then

oForm.Items.Item("7").Click(SAPbouiCOM.BoCellClickType.ct_Regular)

End If

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Shenaz,

When you create the form reference, rather than hardcoding the Form UID, make it unique through variables, etc. I believe there's a way to determine how many instances of a form type are open, so you could just add one to that value and append it to the Form UID. Other manual systems could work, as well.

Regards,

Mark Dielmann

Former Member
0 Kudos

Hi Shenaz,

Try the following code:


If (pVal.FormTypeEx = "Form502") And (oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE) Then

   oForm.Items.Item("7").Click()

End If

If you are opening multiple instances of a form, then you need to trap your event via the FormTypeEx property, not the FormUID.

Regards,

Vítor Vieira

Former Member
0 Kudos

thank u so much for the reply....

i got the solution and i tried same as what u wrote here.....

but i have 1 more doubt...

i'm not able to open another instance of the form.....if i want to open multiple instances of same form ...what should i do???..plz tell me the solution...