frmNavigation is the main form which has navigation buttons and a sub form named NavigationSubForm.
NavigationSubForm: Its source object is a form named sfrmNavigation.
sfrmNavigation has a sub form named subAddNewStudent.
subAddNewStudent: Its source object is a form named sfrmAddNewStudent.
I want to hide the subAddNewStudent subform with an on click event of a button on sfrmAddNewStudent. To do that I want to set focus of the button to another button on NavigationSubForm.
I am new to Visual Basic. My procedure to solve the problem may be wrong. Hope you got my problem. You will get my intention from the code below:
Private Sub btnClose2_Click()
'btnClose2 is a button on sfrmAddNewStudent
Forms! NavigationSubform.btnEdit.SetFocus
'btnEdit is a button on NavigationSubForm
Forms! NavigationSubform.subAddNewStudent.Visible = FalseEnd Sub
It would be a great help if anyone comes forward. Thanks in advance.