[RESOLVED] [Access 2003] DoCmd.OpenTable Processing Problem
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
Code:
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
I only want the code after the DoCmd.OpenTable to be processed when
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.
Re: [Access 2003] DoCmd.OpenTable Processing Problem
You cannot stop the code after DoCdm.OpenTable ... for editing
unless adding a Do...Loop to test repeatedly but that is a very bad way.
The easiest and good way is create a form for that table then open that form (with table view if you want) in Modale mode. The code will wait there until that form is closed or hidden.
Re: [Access 2003] DoCmd.OpenTable Processing Problem
Hi anhn,
Not sure how would work.
Could you please advise on the steps needed.
I am wanting to open the table, then paste in a load of data. could be
several thousand rows of data, then when the table is closed I want to
process the data in the table.
Re: [Access 2003] DoCmd.OpenTable Processing Problem
The easiest method I think:
Use two buttons - one for the open - one for the processing.
Re: [Access 2003] DoCmd.OpenTable Processing Problem
I agree that using two buttons is the easiest, although I was hoping to avoid it if possible.