cancel
Showing results for 
Search instead for 
Did you mean: 

Set Focus

Former Member
0 Kudos

Hi All,

Can anybody suggest me how to set focus ?

Means i have taken two Textbox and on first Textbox i done following code for "Not Empty", means if first Textbox is blank it show error "Not Empty". But after that focus goes on second Textbox.

I want if it is blank then shows error message and focus also set there. If i fill any in that then focus goes to second Textbox.

If edittext.Value = "" Then

SBO_Application.SetStatusBarMessage("Not Empty", BoMessageTime.bmt_Short, True)

End If

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Harish,

Try this,

If oFirstTextBox.Value = "" Then
       SBO_Application.SetStatusBarMessage("Not Empty", BoMessageTime.bmt_Short, True)
       BubbleEvent = False
EndIf

Or u can also do the following

If oFirstTextBox.Value = "" Then
       SBO_Application.SetStatusBarMessage("Not Empty", BoMessageTime.bmt_Short, True)
       oForm.Items.Item("1st Edit Box ID").Click(SAPbouiCOM.BoCellClickType.ct_Regular)
EndIf

Harish, In which event are u checking this..??

Hope this solves it.

Regards,

Vasu Natari.

Edited by: vasu natari on Aug 13, 2008 6:55 AM

Former Member
0 Kudos

Hi Vasu,

I tried code which u send me, in second code not set focus it goes next Textbox. I run this code with break point it execute 2 times. This code i tried on Lost_Focus event. Can u plz tell me what shold i do now ?

And first code where or on which event should i write ? Item_Event or Menu_event.

Thanks and Regard's

Harish Patil.

Former Member
0 Kudos

Hi Vasu,

I tried code which u send me, in second code not set focus it goes next Textbox. I run this code with break point it execute 2 times. This code i tried on Lost_Focus event. Can u plz tell me what shold i do now ?

And first code where or on which event should i write ? Item_Event or Menu_event.

Thanks and Regard's

Harish Patil.

Former Member
0 Kudos

Harish,

U gotto write this code in the Item Event in the Lost Focus event in the Before action = False part.

Vasu Natari.

Answers (1)

Answers (1)

Former Member
0 Kudos

If the first textbox is empty the focus should not be moved to the second text box....Whether this is ur question...?

Former Member
0 Kudos

Hi

Yes This is my question.

Thanks,