Access 2010 macros

15 pts.
Tags:
Access 2010
Access macros
Access query
IIF function
IIF statement
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?
ASKED: February 2, 2011  7:14 PM
UPDATED: February 4, 2011  2:21 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

To start with, does the report get closed before you try to rerun the macro?

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Chippy088
    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 pointsBadges:
    report
  • Danna
    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 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following