Boat Drinks  

Go Back   Boat Drinks > General > Computer and Consoles

Reply
 
Thread Tools Display Modes
Old 22-09-2006, 12:56   #1
Dymetrie
A large glass of Merlot
 
Dymetrie's Avatar
 
Join Date: Jun 2006
Location: Letchworth with a Lightsaber
Posts: 5,819
Default Me + Access = badness

So I'm working on a little project at work at the moment. A nice happy little database to track Covert Camera installations.

I open Access and create a table.. Lovely, I write a macro to automatically calculate the Cancellation due date (installations can only go in for 3 months) and review dates for the installation. After some hitting things with hammers I get all that to work.

Now comes the fun part.

I want this database to automatically send out e-mails to remind Housing Officers of review dates. No problem, I get a nice little macro running which, when run, sends out an e-mail (the content at the moment is a load of tosh, I just want to get it working first of all).

Then I wrote a new Macro.

The Macro of EVIL!

If the review date of the installation is the same as today's date run e-mail macro... Simple...

It managed to spam out 97 e-mails before I managed to pull the plug Methinks the exchange server at work is possibly a mite peeved at me now

Now comes a fun afternoon of trying to figure out what I ballsed up (I refuse to run that macro again without some kind of safeguard, like yanking the network cable out first) and to get it to run properly...

If anyone has any advice then it'd be more than welcome as my Access guru appears to be asleep today. (can't access forums when I'm meant to be working but e-mail works)

*runs off to spam some more e-mails*
__________________

Khef, Ka and Ka-Tet....
Dymetrie is offline   Reply With Quote
Old 22-09-2006, 16:15   #2
Garp
Preparing more tumbleweed
 
Garp's Avatar
 
Join Date: Jun 2006
Location: Hawaii
Posts: 6,038
Default

Debug mode dude... bring up the macro and step through it (F8 I think?). Put a few watches on for various variables in the code, and then step through watching what values they are. You should soon spot why its looping.
__________________
Mal: Define "interesting"?
Wash: "Oh, God, oh, God, we're all gonna die"?
Garp is offline   Reply With Quote
Old 22-09-2006, 17:28   #3
kaiowas
The Stig
 
kaiowas's Avatar
 
Join Date: Jul 2006
Location: Fightertown USA
Posts: 1,458
Default

And most importantly comment out the line in the email macro that actually sends the mails whilst you're still playing!!
__________________

Anal Fish Porn
kaiowas is offline   Reply With Quote
Old 22-09-2006, 19:54   #4
William
Vodka Martini
 
William's Avatar
 
Join Date: Jul 2006
Location: Church Broughton
Posts: 533
Default

I wrote a Macro of evil today as well, it causes 10 seconds of excel flickering and spasming until it comes up with the answer.
__________________
William is offline   Reply With Quote
Old 22-09-2006, 20:17   #5
Garp
Preparing more tumbleweed
 
Garp's Avatar
 
Join Date: Jun 2006
Location: Hawaii
Posts: 6,038
Default

Quote:
Originally Posted by William View Post
I wrote a Macro of evil today as well, it causes 10 seconds of excel flickering and spasming until it comes up with the answer.
Turn off screen updates. Added bonus, it runs quicker.
__________________
Mal: Define "interesting"?
Wash: "Oh, God, oh, God, we're all gonna die"?
Garp is offline   Reply With Quote
Old 22-09-2006, 20:21   #6
Dymetrie
A large glass of Merlot
 
Dymetrie's Avatar
 
Join Date: Jun 2006
Location: Letchworth with a Lightsaber
Posts: 5,819
Default

Quote:
Originally Posted by Garp View Post
Turn off screen updates. Added bonus, it runs quicker.
I'll be having a chat with you this weekend youngun
__________________

Khef, Ka and Ka-Tet....
Dymetrie is offline   Reply With Quote
Old 22-09-2006, 21:15   #7
kaiowas
The Stig
 
kaiowas's Avatar
 
Join Date: Jul 2006
Location: Fightertown USA
Posts: 1,458
Default

Quote:
Originally Posted by Garp View Post
Turn off screen updates. Added bonus, it runs quicker.
Of course, if you want to code it properly you could just get rid of all the unnecessary "worksheet.activate"s and "range.select"s as well.

Is this a bad time to admit doing Excel VBA for a living?
__________________

Anal Fish Porn
kaiowas is offline   Reply With Quote
Old 23-09-2006, 10:34   #8
Garp
Preparing more tumbleweed
 
Garp's Avatar
 
Join Date: Jun 2006
Location: Hawaii
Posts: 6,038
Default

Quote:
Originally Posted by kaiowas View Post
Is this a bad time to admit doing Excel VBA for a living?
*bows to the expert*

I write crappy Excel VBA macros only when forced to

I'm not a programmer despite what people in previous jobs may think. I don't enjoy it, I don't have the right kind of mindset for it. The fact that I can get the macro written to do what they wan't does mean either a) I enjoy doing it, b) I want to do it, or c) that it'll be anywhere close to efficient.
__________________
Mal: Define "interesting"?
Wash: "Oh, God, oh, God, we're all gonna die"?
Garp is offline   Reply With Quote
Old 22-09-2006, 21:30   #9
William
Vodka Martini
 
William's Avatar
 
Join Date: Jul 2006
Location: Church Broughton
Posts: 533
Default

Quote:
Originally Posted by Garp View Post
Turn off screen updates. Added bonus, it runs quicker.
No I prefer it this way, it makes people at work think I have done somthing really clever and complicated then they leave me alone so I can play minesweeper all day.
__________________
William is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:47.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.