Well, it's been quite a while away from Access, but let's see if I can help.
Question: why do you have to click a button first for the query params window to popup then supply the params? Why not put textboxes on the form where the params can be entered in directly?
This way, code the button to open the same form passing in the params, and possibly some passing some openargs argument to set some sort of flag, if needed.
HTH