I have a form with a command button that launches a series of code and then opens a query. The form is set up as a popup, so it remains in front of the resulting query displayed. I tried minimizing the form, but it is difficult for the user to find as it gets very tiny and is easily overlooked.
What I would like to do, is have the form go to the back of the query and when the user closes the query window, have the form return to the front full sized. I tried the visible - not visible option but not sure how to make it visible dependent on the user closing the query window...
I am stumped. Any help provided is greatly appreciated!
Here is the code that sits on the on-click event of my command button on the form:
Private Sub Command58_Click()
'First step runs the query to append rows to the voucher table for those providers that are showing as on file in the AP system and if so adds them to the table
DoCmd.GoToRecord , , acNext
DoCmd.GoToRecord , , acPrevious
' This step Checks to see if the minimum number of vendors on file with AP has been met
Dim CNT_Tax_ID As Variant
CNT_Tax_ID = CurrentDb.QueryDefs("QRY_COUNT_VOUCHER_LOAD").OpenRecordset.Fields("TAX_ID")
If CNT_Tax_ID < 7 Then
MsgBox "you currently have " & CNT_Tax_ID & " vendors existing in the AP system. You must have a minimum of 7 existing vendors for a voucher bulk load submission to AP, please submit a manual check request for these vendors._
The spreadsheet listing the details needed will display when you click on OK"
Me.CMD_VCHR_LOAD.Enabled = False 'disables the button to create the voucher load because minimum number of vendors existing in AP has NOT been met
'**this is the query that displays - here is where I want the form to come back to the front when the user closes the query window***'
MsgBox "you have the minimum of 7 providers not previously submitted to AP, go to the voucher load form to create the spreadsheet to be uploaded to AP"
Me.CMD_VCHR_LOAD.Enabled = True 'enables the bulk load button because minimum number of vendors existing in AP has been met