473,326 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

eMail Problem in Access 2007

I am trying to do the exact same thing; I want to create a button on my form in Access 2007 that, when clicked, opens a new email in Outlook with only the To: field filled in. I tried the code posted by ADezii (replacing [COMPANY_EMAIL] with the name of my field [GROUP_EMAIL_ADDRESS]) but nothing happens when I click the button.

I am completely new to Access and VB so I'm not sure if there is anything else in the code that I need to change to make it specific to my database. Any help on this would be greatly appreciated as I have been trying to figure this one button out for two weeks now.
May 14 '10 #1

✓ answered by Jim Doherty

@KendraAsh
You are absolutely right that was my typo sorry!!. I will get it right must be having a dense period today. The 'mailto:' is essential the followhyperlink needs that text plus the colon to prefix your email address in order to recognise that it needs to MAIL

Expand|Select|Wrap|Line Numbers
  1. Dim myemail as string  
  2. myemail="mailto:" & Me!YourTextBoxName  
  3.  
  4. FollowHyperlink myemail

15 2089
NeoPa
32,556 Expert Mod 16PB
This post has been moved from Hyperlinks, input masks, and sending email in Access 2007, where any relevant or referenced code may be found.

Kendra,

This clearly isn't exactly the same problem, otherwise you wouldn't require further help. If you need help, then you need to create your own thread and not hijack someone else's.

You may want to specify more clearly exactly what you hope to receive from this question. Expecting someone to check how it fits your database is not likely to get you very far as no-one here knows anything about your database.

I'm sure if you can make your requirement clear then someone can probably help you.

Welcome to Bytes!
May 14 '10 #2
Sorry I've never tried getting help on a forum before.

I have created a database in Access 2007 of all the community groups with which my company works. From this database, I created a form to make it a bit easier for others to view and change records. I've noticed that when anyone wants to email one of these groups, they have to copy the email address from the form and paste it into a new message in Outlook.

I want to make this process easier by creating a button users can click on which will automatically open up a new email window with the To: field pre-populated based on the record the user was viewing.
May 14 '10 #3
Jim Doherty
897 Expert 512MB
@KendraAsh
Place this simple command in the on click event of your button. You can then pass the contents of that form textbox to the variable myemail, which in turn is used by the FollowHyperlink command to open an email message. The email address is placed in To: section of the mail window as you require.

Expand|Select|Wrap|Line Numbers
  1. Dim myemailTo as string
  2. myemail=Me!YourTextBoxName
  3.  
  4. FollowHyperlink myemail
May 14 '10 #4
NeoPa
32,556 Expert Mod 16PB
KendraAsh: Sorry I've never tried getting help on a forum before.
That's perfectly fine. I could see you were new and didn't intend to sound heavy.

I would say though, that you can get so much more from a site such as this (others too of course) with a better understanding of the dos and don'ts of forum etiquette. Our FAQ (FAQ: Posting Guidelines) has some useful guidance that will help you steer through the more obvious pitfalls. Forum sites such as ours can offer so much to people who are trying to learn.
May 15 '10 #5
Hi, sorry for the late response.

I tried the code provided by Jim Doherty but nothing happens when I click the button.
May 26 '10 #6
Jim Doherty
897 Expert 512MB
@KendraAsh
Apologies I obviously missed in my pasting one of the main elements. The code below relies on an email address in your textbox, but the command should also have the "mailto:" prefix in order for it to work

Revised as follows

Expand|Select|Wrap|Line Numbers
  1. Dim myemailTo as string 
  2. myemail="mailto:"& Me!YourTextBoxName 
  3.  
  4. FollowHyperlink myemail 
May 26 '10 #7
Still doesn't work. :(

This may just be something about VBA that I don't understand, but I noticed that your first line has myemailTo but the other two times you use this, there is no To on the end. I don't need it there for this code to work, do I?
May 26 '10 #8
Jim Doherty
897 Expert 512MB
@KendraAsh
You are absolutely right that was my typo sorry!!. I will get it right must be having a dense period today. The 'mailto:' is essential the followhyperlink needs that text plus the colon to prefix your email address in order to recognise that it needs to MAIL

Expand|Select|Wrap|Line Numbers
  1. Dim myemail as string  
  2. myemail="mailto:" & Me!YourTextBoxName  
  3.  
  4. FollowHyperlink myemail
May 27 '10 #9
Unfortunately, the button still does nothing when I click on it.
May 27 '10 #10
Jim Doherty
897 Expert 512MB
@KendraAsh
How do you mean does nothing? Does it not give you anything?

The "mailto: " portion of that command is actually unnecessary in Access 2007 as it should recognise email addresses contained in the textbox

try replacing with one space after the colon

myemail="mailto: " & Me!YourTextBoxName
May 27 '10 #11
I mean I've entered the code in the on click event but when I view the form and try clicking the button it doesn't do anything; it doesn't open a mail window or even give me an error message of any sort.

I tried it with the space and I still get nothing :(

In theory I understand how this works but every other code I have tried hasn't worked either.

Perhaps there is something wrong with the database itself? I mean it is a very simple database for contact and statistical information. I have a column named GROUP_EMAIL_ADDRESS that I have bound to a control in my form. I have called that control MsgAddress. I have tried this code with both names entered and neither returns any results. I have also tried naming the column and the control the same thing and that doesn't work either.

It seems like the more I learn about VBA code, the more I don't understand why this isn't working for me. Are there perhaps some troubleshooting methods I could run through to see if the problem is not the code but somewhere else?
May 27 '10 #12
Jim Doherty
897 Expert 512MB
@KendraAsh
have you enabled your code on this database?? ie is there a security warning telling you to enable content just beneath the ribbon if so then enable else nothing will work
May 27 '10 #13
I feel so silly I didn't know what that warning was about so just in case I left it alone. Now the code works perfectly, thank you so much :D
May 27 '10 #14
Jim Doherty
897 Expert 512MB
@KendraAsh
Thats ok.... I had the distinct impression it would be something really simple so you are up and running now...good
May 27 '10 #15
NeoPa
32,556 Expert Mod 16PB
KendraAsh: It seems like the more I learn about VBA code, the more I don't understand why this isn't working for me. Are there perhaps some troubleshooting methods I could run through to see if the problem is not the code but somewhere else?
I know you won't be needing this now as Jim has pointed you in the right direction already, but as you asked, it may still prove useful in future, Debugging in VBA.
May 27 '10 #16

Sign in to post your reply or Sign up for a free account.

Similar topics

42
by: aaron.kempf | last post by:
since Access 2007 is a 'major change' then i assume that MS is going to make a new newsgroup for it. I mean; when VB.net 2002 came out; they decided to rename the 'main vb newsgroup' as...
3
by: Michael | last post by:
I work with a highly programmed Access database (some 15,000 lines of VBA code, much of it automating data entry on forms -- and believe me, it's very tight code). In Access 97, 2000, 2002, and...
5
by: ARC | last post by:
Hello, A user posted a reply to a post of mine regarding the fact that Access 2007 would be free, or maybe I misunderstood? All I could find on Microsoft's site was information regarding the...
17
by: Neil | last post by:
A client of mine likes some of the new bells and whistles in Access 2007, and is thinking about converting our A03 format MDB to an A07 format file. However, while some of the users have A07, many...
4
by: Neil | last post by:
Just found out that the Microsoft Rich Textbox does not support full text justification, since it's based on Version 1.0 of the RichEdit Window Class, and full text justification is only available...
16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
5
by: Hollywood | last post by:
Good day dear members of the comp.databases.ms-access newsgroup. Please I need your help on the following. I'm the administrator of an Access 2007 database. I would like my enterprise personnel...
8
by: elias.farah | last post by:
Hello Everyone, I'm having some very weird behavior on a couple of Access forms. (Not all forms, just some of them). The forms have been working for years, under Access XP/2003 etc, and last...
9
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
5
by: sphinney | last post by:
Basic question: Does anyone know how to go about adding a control to an Access 2007 form that will allow viewing a Word 2007 document? Reason for asking: My office is about to receive 100+/-...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.