How to make the Modal Form closed first, and then run codes after its opening-Form-command?

Copper Contributor

Hello, I am new to this Access community, and need your expertise to fix my problem during developing an Access application.

I designed the pop-up and Modal form to first get user to input a file name and its file folder name, and then export the search result to that file. My problem is after opening the modal form, the Access continually executes the codes after its open-modal-form command (DoCmd.OpenForm). I wanted to wait for that the modal form is closed first, and then run the codes after the open-modal-form command.

I very appreciate your advice.

Thanks,

 

DingChen

1 Reply

@DingChen018 

I fixed the problem because I didn't set right parameters as follows.

DoCmd.OpenForm "frmInputFileName", acNormal, , , , acDialog

now the modal form is keeping open until it is closed, and then the codes after the Open-Form command are executed.

Thanks for your review.