Yep. Never trust the users to do something that could ultimately have your code look bad. They all too often want to say, 'the database…"
I would certainly have like John is saying the execute of the query run but as a function returning a true
That way you would only run the report based on the success of that query being run.
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Friday, August 11, 2017 10:19 AM
To: John Viescas JohnV@msn.com [MS_Access_Professionals]
Subject: Re: [MS_AccessPros] Question about performance of Databases
John,
Should I include Do Event in the code or will the execute not need that?
Jim Wagner
On Friday, August 11, 2017 08:45:05 AM, John Viescas JohnV@msn.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
Also, don't run the queries from a macro. Run them from VBA using the .Execute method of a database object with dbFailOnError option, and put in an error trap.
John Viescas, author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Access Applications
On Aug 11, 2017, at 10:04, crystal 8 strive4peace2008@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
hi Jim,
store the date calculated in a database property or table. When records are changed, also store that date. When the report is opened (maybe you can do this on Open event), compare dates to see if macro/code needs to run.
respectfully,
crystal
~ have an awesome day ~
On 8/11/17 9:29 AM, luvmymelody@yahoo.com [MS_Access_Professionals] wrote:
Hello all,
One of the databases that I support, caused quite a stir yesterday. there is a report that is sent out from Access that shows the budgets for departments. This report is sent to the department heads. Apparently the user did not validate the data before emailing to the executive director. The budget numbers balance differences were way off. Of course it was the database's fault and ultimately my fault. Most were understanding, but there were some that were very unhappy and I was called into my boss' office.
There is a macro that must be run before the reports are sent out. The user says that she clicked the button to run the macro. But as I went through the macro and found the query that updates the balance difference, I ran the macro on its own and the report was fine. So she either did not run the macro or the query in the macro did not run.
Which leads me to two scenarios.
- she did not run the macro
- the macro ran but the query was skipped.
if she did not run the macro ---- end of issue
if she did run the macro and the query was skipped. Does that happen?
we have network issues here. it is intermittent in my opinion. could the intermittent network cause the query to skip in a macro?
What should I do?
Thank you
Jim Wagner
This email (and all attachments) is for the sole use of the intended recipient(s) and may contain privileged and/or proprietary information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
Posted by: Liz Ravenwood <Liz_Ravenwood@beaerospace.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (7) |
Tidak ada komentar:
Posting Komentar