I need to be able to click a button on a form that will then open a table,
and refrain from continuing the processing of the code until the user closes the
table.
The code I am using is as follows
I only want the code after the DoCmd.OpenTable to be processed whenCode:Private Sub CmdProcessAIQ_Click() On Error GoTo Err_CmdProcessAIQ_Click DoCmd.OpenTable "AIQPaste", acViewNormal, acEdit MsgBox "This should only be processed when Table is closed." Exit_CmdProcessAIQ_Click: Exit Sub Err_CmdProcessAIQ_Click: MsgBox "Form_Main - CmdProcessAIQ_Click - " & Err.Number & vbCrLf & Err.Description Resume Exit_CmdProcessAIQ_Click End Sub
the table is closed.
However as it stands at present the msgBox is appearing immediately after the table has been opened.
How can I prevent this from happening, or set up code to be processed when
the table is closed.





Reply With Quote