Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email form Access 1

Status
Not open for further replies.
Feb 25, 2004
5
US
Is it possible to create an Email list in Access that would allow you to right click the address, which is in a field, and it pull up your email compose window?

Also, thanks to those who answered my question on creating a calculation to define a person's age. Your answers helped me a great deal and I did get it to work.

Thanks,
Keith
 
Yes, it's possible.

I would make a command button next to the field with the e-mail address. Set the command button (when clicked) to use the e-mail address in the field as the default e-mail e-mail address for the composed e-mail.

Let me know if you need more specific info - not sure how much you know about Access.

VBAinChicago
 
vbainchicago, Thanks for the response. Yes, I could sure use some instructions on setting this up. I am accustomed to building forms and using the command buttons to open forms, reports, etc.. but not familier with these more detailed operations. I just need to be able to go to my customer list in Access and quickly click to email a client. Right now, I use Access as my database, but then have to enter their info in Outlook to be able to email them.

Any info will help.

Thanks,
Keith
 
I found this code and use it send mail (it loads the mail Program)and lets users send you a email. I know it does not answer you question but unless you use VB I do not know how a number of names to a email list.

Option Compare Database
Option Explicit

Private Const HH_mailto_Dialog As Integer = 6

' Declarations to call the default browser
Private Const SW_SHOWNORMAL = 1

Private Declare Function CxtWebHelp Lib _
"shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

Public Sub ShowHelpContext(hwnd As Integer, nContextId As Integer)

Dim strTopic As String
Dim strFullPath As String
Dim strPathOnly As String

' Display help via the HTML Pages of the WebHelp directory or
' URLs of the WebHelp topics
Select Case nContextId
Case HH_mailto_Dialog
strTopic = "mailto:YOURNAME@YOURSITE.COM"
Case Else
strTopic = "notfound.htm"
End Select

' Get the path to the database
strFullPath = CurrentDb.NAME
strPathOnly = Left$(strFullPath, Len(strFullPath) - Len(Dir(strFullPath)))

CxtWebHelp hwnd, vbNullString, strTopic, vbNullString, _
strPathOnly + "\WebHelp\", SW_SHOWNORMAL

End Sub

' These next two functions are called via two Runcode macros
' that are in-turn called by items on the WebHelp menubar/toolbar.
' Note that the first argument is 0 since the menus can't pass
' the correct window handle.
Public Function ShowContents() As Long

ShowHelpContext 0, 5

End Function

Public Function EmailEhelp() As Long

ShowHelpContext 0, 6

End Function
 
KeithG,

Here's a quick snippet of code that will help you accomplish what you're after:

'opens an e-mail with the address in a form field
Dim email As String
email = ([Forms]![FormName]![FormFieldName])
DoCmd.SendObject acSendNoObject, "", "", email
End Sub

Replace "FormName" with the name of your form and "FormFieldName" with the name of the field on your form that has the e-mail address. This is the "event" that the on click action will trigger on your command button.

Let me know if you have any questions.




VBAinChicago
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top