Skip to: Site menu | Main content

Email Hyperlinks in MS Access, and other things...

2007-06-02

Another cool application in the worksThis has absolutely nothing to do with the theme of my blog but I get so involved in database design (it's like a hobby for me.)

I'm currently updating an antiquated Access 97 database at work. It's a personal desire to do this contractually for a living, I'm really not that good at it but this opportunity at work is a great way to prove my current skill level.

Emails from your database...

One thing people would like to be able to do with their contact database is send emails directly from the contact information page/form. I'm not a professional at this but I really wanted to tackle this one. I did some internet searching looking for a solution. I came accross some articles on how to send an email directly from the database. That wasn't exactly what I was looking for. What I wanted was a hyperlink to direct email. You know, you point your mouse to the email and it turns into a hand and you click and it opens your default email programs new message with the person's email right there. Now, in Access, you can have a hyperlink field and use it for such but here are some of the problems with that solution:

Access formats your address (whatever you type in for that field) as a web address. For instance, you type "www.mywebpage.com" and Access formats your page as an actual hyperlink "http://www.mywebpage.com" That's great, for web pages. I want to send emails. If you type, "bro_chris@myemail.com" Access formats your email address as a web page "http://bro_chris@myemail.com" (it doesn't know better) and when you hover over it you get the fancy hand pointer mouse, but when you click Access opens your web browser (not your email program) and attempts to view your email address as a web page. Obviously, this doesn't work. Well, you can make Access go to email manually by typing "mailto: bro_chris@myemail.com" and it works fine except A) you hyperlink always reads "mailto: bro_chris@myemail.com" which users don't aways understand and B) how many average users know that they need to type "mailto:" every time. Most applications do that thinking for them.

So what did I do to solve this? I read an article in a book about how I could programatically change the address after it's keyed. This works but... It still reads "mailto: bro_chris@myemail.com" and I didn't like it. The solution came to me. I'll make a button do this. I tried command buttons but I couldn't figure out how to run the same action that takes place with the mouse over hyperlink does, that was the effect I wanted. I came up with another solution. I made a text box and had it reflect the email address formated as an email address. How so? I added a field in the query that the form was based on. That field was called "email" and it was formatted as such: =IIF(IsNull([emailaddress]),"","mailto:" & [emailaddress]) So, when you hover over that text box, vuala! the imfamous hyperlink mouse over affect, but, you see this akward extra email box that shows that strange "mailto: bro_chris@myemail.com" Not very attractive... So what did I do? I did a couple cool things to resovle this. One, I changed the text color to match the background color so it was invisible. Second, I made the text box smaller and formatted it to look like a button. Now I have a button that does the same work. People were happy to see this new addition. A simple solution. I'm sure there are better and if you know of one, please share it. I always like a better solution.

So you want to merge your record (the current one or a batch of letters) try this: http://www.members.shaw.ca/AlbertKallal/wordmerge/page2.html

This man, Albert Kallal, made a total solution for anyone's Access database. All you do is import the modules and a couple forms. You add a command button to your form (any form that contains the the data you want to merge.) and add to the onclick event one line of code: MergeSingleWord. That's it. Open your form and click on the button and watch the magic happen before your eyes. This was another solution the people I work for wanted. The glory of this revelation is this: "You don't have to be a super programmer to build dynamic applications. The key is knowing how to find solutions and import them in to your application." Many thanks to Albert Kallal, your solution is working great.

Anyone else interested in Access databases and VBA? Please drop me a line.

An Observant Policeman

2007-06-02

 An honest man was being tailgated by a stressed out woman on a busy boulevard.

Suddenly, the light turned yellow, just in front of him.

He did the right thing, stopping at the crosswalk, even though he could have beaten the red light by accelerating through the intersection.

The tailgating woman hit the roof, and the horn, screaming in frustration as she missed her chance to get through the intersection, dropping her cell phone and makeup.

As she was still in mid-rant, she heard a tap on her window and looked up into the face of a very serious police officer.

The officer ordered her to exit her car with her hands up. He took her to the police station where she was searched, finger printed, photographed, and placed in a holding cell.

After a couple of hours, a policeman approached the cell and opened the door. She was escorted back to the booking desk where the arresting officer was waiting with her personal effects.

He said, "I'm very sorry for this mistake. You see, I pulled up behind your car while you were blowing your horn, flipping off the guy in front of you, and cursing a blue streak at him.

"I noticed the 'Choose Life' license plate holder, the 'What Would Jesus Do' bumper sticker, the 'Follow Me to Sunday-School' bumper sticker, and the chrome-plated Christian Fish emblem on the trunk.

Naturally... I assumed you had stolen the car."

    . . . priceless.

What Is Intelligence, Anyway?

2007-06-01

What is intelligence, anyway? When I was in the army, I received the kind of aptitude test that all soldiers took and, against a normal of 100, scored 160. No one at the base had ever seen a figure like that, and for two hours they made a big fuss over me. (It didn't mean anything. The next day I was still a buck private with KP - kitchen police - as my highest duty.)
All my life I've been registering scores like that, so that I have the complacent feeling that I'm highly intelligent, and I expect other people to think so too. Actually, though, don't such scores simply mean that I am very good at answering the type of academic questions that are considered worthy of answers by people who make up the intelligence tests - people with intellectual bents similar to mine?
For instance, I had an auto-repair man once, who, on these intelligence tests, could not possibly have scored more than 80, by my estimate. I always took it for granted that I was far more intelligent than he was. Yet, when anything went wrong with my car I hastened to him with it, watched him anxiously as he explored its vitals, and listened to his pronouncements as though they were divine oracles - and he always fixed my car.
Well, then, suppose my auto-repair man devised questions for an intelligence test. Or suppose a carpenter did, or a farmer, or, indeed, almost anyone but an academician. By every one of those tests, I'd prove myself a moron, and I'd be a moron, too. In a world where I could not use my academic training and my verbal talents but had to do something intricate or hard, working with my hands, I would do poorly. My intelligence, then, is not absolute but is a function of the society I live in and of the fact that a small subsection of that society has managed to foist itself on the rest as an arbiter of such matters.
Consider my auto-repair man, again. He had a habit of telling me jokes whenever he saw me. One time he raised his head from under the automobile hood to say: "Doc, a deaf-and-mute guy went into a hardware store to ask for some nails. He put two fingers together on the counter and made hammering motions with the other hand. The clerk brought him a hammer. He shook his head and pointed to the two fingers he was hammering. The clerk brought him nails. He picked out the sizes he wanted, and left. Well, doc, the next guy who came in was a blind man. He wanted scissors. How do you suppose he asked for them?"
Indulgently, I lifted by right hand and made scissoring motions with my first two fingers. Whereupon my auto-repair man laughed raucously and said, "Why, you dumb jerk, He used his voice and asked for them." Then he said smugly, "I've been trying that on all my customers today." "Did you catch many?" I asked. "Quite a few," he said, "but I knew for sure I'd catch you." "Why is that?" I asked. "Because you're so *censored* educated, doc, I knew you couldn't be very smart."
And I have an uneasy feeling he had something there.


Isaac Asimov

Created with ShoutPost