Hi,
You can submit the form and close the form by putting the rules on the submit button.
1. Add a submit connection using sharepoint library.
2. Place the value or field that should be shown as File name.
3. Check the ‘Allow overwrite if file exists' check box.
4. Go to button properties.
5. Select ‘Submit' in Action drop down.
6. Click on submit options button and choose the data connection which is taken above.
7. Click Submit options button and select ‘Close the Form'. Click ok to close all the windows.
8. Do the same for all the buttons.