0
votes

I have a submit button inside the subform. When I clicked my submit button then this will click on of my Navigation TAB on the Main Form. The code must be executed inside the submit button event in VBA. Please any help would be appreciated.

1
Which exact event is triggered when you click 'submit' ? - Vlado
Submit event executes an update query and then I need to reload the subform. That's why I want to click the `Main From Nav Tab' after executing the update query. - Mir Abzal Ali

1 Answers

1
votes

Your description is very unclear but if you want to run a code on Main Form than just create on it a public sub which would do your refresh:

Public Sub MyRefreshSub()
    ' refresh your main form here
End Sub

and on _Click event of the Submit button of subform call it like this:

Private Sub Submit_Click()
    Me.Parent.MyRefreshSub
End Sub

or if you want just click the Tab:

Private Sub Submit_Click()
    Me.Parent.TabCtl0_Click
End Sub

I hope I understood your question right.