Textbox.setfocus is executing textbox_exit event twice VBA

Lakshminagarajan Seetharaman 1 Reputation point
2021-06-11T07:01:34.23+00:00

i have 6 checkbox,3 listbox and 6 textbox with values as 10. Iam adding some values based on check box1.value=true (i.e) AA0,AA1 and AA2to the listbox1 .

Iam adding some values based on check box2.value=true (i.e) BA0,BA1and BA2to listbox 2.

if I select an item in the listbox(AA0,AA1,AA2) and if the textbox1.text is >10 or null then I have to set the focus(text1.setfocus) in the listbox_change event

in this code when I click the chkbox1 or 2 or 3 and select the options in the Listbox1 OR Listbox2 or listbox3 sometimes in any one of the three I am getting the msg MsgBox "PLEASE CHK THE mark " and the selected item in the listbox gets deselected and the focus goes to textbox.

Pls Help

Office Visual Basic for Applications
Office Visual Basic for Applications
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Visual Basic for Applications: An implementation of Visual Basic that is built into Microsoft products.
1,502 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.