15 pts.
 Access 2010 macros
I have a macro that 1)starts with a make-table query, 2)opens a report based on the new table, then 3)runs an If statement stating IF [Reports]![Reject Report]!="NO" THEN EmailDatabaseObject called "Reject Report". . . My problem is that after the macro completes it locks the table that was made earlier and I cannot run the macro again unless I close the entire database and reload it. (I get a error message saying that the table is locked by another user. Please wait until the other user closes out of the program and try again; or something like that.) There is no one using the database during these tests so I have no idea why the table is staying locked. Do you have any ideas on how to modify the macro to allow it to run consistantly?

Software/Hardware used:
ASKED: February 2, 2011  7:14 PM
UPDATED: February 4, 2011  2:21 PM

Answer Wiki:
To start with, does the report get closed before you try to rerun the macro?
Last Wiki Answer Submitted:  February 4, 2011  2:21 pm  by  Randym   1,740 pts.
All Answer Wiki Contributors:  Randym   1,740 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

We need to see the whole of the macro code to make any suggestions.

Without looking at the code, I’d suggest closing the table and report in the macro. It seems it is terminating abnormally with the tables and report still left open, that’s why you have to manually close it down.

Do you get a debug report from the macro? That might give more suggestions of what is wrong.

 4,625 pts.

 

Chippy088, Thanks for answering my dilemma. I did put in a close table at the end of the macro once but I still got the same error.
I am a little new to the ACCESS 2010 screens and haven’t quite figured out where (or how) to use their debug report yet. I will try it though.
My complete macro is as follows:
BUILD TEMPORARY TABLE CALLED FillerMaterialStatusReport
OpenQuery
Query Name MQry-Filler MaterialReleaseInfo
View Datasheet
Mode Edit
CloseQuery
Query Name: MQry-Filler MaterialReleaseInfo
Save No
BUILD RELEASE REPORT
OpenReport
Report Name: Release Report
View: Report
(no filters or conditions specified)
EMAIL RELEASE REPORT
If [Reports]![Release Report]![Latest Date Released] Is Not Null Then
EMailDatabaseObject
Type: Report
Name: Release Report
Format: RTF
To
Cc
Bcc
Subject Filler Material Release Report
Message: (blank)
Edit message YES
PRINT RELEASE REPORT
OpenReport
Report Name: Release Report
View: Print
(no filters or conditions specified)
CloseWindow
Type: Report
Name: Release Report
Save: Prompt
End If
BUILD REJECT REPORT
OpenReport
Report Name Reject Report
View Report
(no filters or conditions specified)
EMAIL REJECT REPORT
If [Reports]![Reject Report]![Passed]="NO" Then
EMailDatabaseObject
Type: Report
Name: Reject Report
Format: RTF
To
Cc
Bcc
Subject Filler Material Reject Report
Message Reject materail. Please contact vendor for correctie action.
Edit message Yes
PRINT REJECT REPORT
OpenReport
Report Name: Reject Report
View: Print
(no filters or conditions specified)
CloseWindow
Type: Report
Name: Reject Report
Save: Prompt
End If


 15 pts.