Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 8th, 2009, 02:31 PM
Registered User
Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default E-mail user with two seperate fields

I have a table with employee info, the name is in two separate columns(first and last). I would like a way of clicking on a button next to the persons name and it emailing them.
Between the first name and last name is a period and then filling in the @soandso.com part.

Is this relatively easy to do?

****please forget this thread. Exchange server finds the user without a full address.

Last edited by Dallas_Spohn; May 8th, 2009 at 02:35 PM..
Old May 13th, 2009, 10:06 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG

When you click the button, the e-mail address (in your case) is simply the concatenation of the two fields plus the rest of the address. So assuming the first and last names were in textboxes called, e.g. txtFirstName & txtLastName, then put this code somewhere on the button's click event code.

Dim strEmail as String, strFirstName as String, strLastName as String
strFirstName = Trim(Nz(Me.txtFirstName, ""))
strLastName = Trim(Nz(Me.txtLastName, ""))
If Len(strFirstName) = 0 Or Len(strLastName) = 0 Then
    MsgBox "User Name is not properly entered.", vbCritical, "Invalid Name!"
    strEmail = strFirstName & "." & strLastName & "@soandso.com"
End If
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division

Last edited by SerranoG; May 13th, 2009 at 12:38 PM..
Old May 13th, 2009, 11:34 AM
Registered User
Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

thank you...

Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i mail the password to the user? ayem Visual Studio 2008 3 August 13th, 2008 06:52 AM
Finding User form fields on ASP webpage Ahrenl Excel VBA 0 July 4th, 2006 09:54 AM
Concatenating fields (user input 2 journal) tonyadams Access VBA 19 March 17th, 2006 01:10 AM
send e-mail to user after registration 2 p2ptolu Classic ASP Databases 0 April 18th, 2005 06:28 AM
SMTP Mail with User Authentication ~Bean~ VB How-To 0 November 6th, 2003 10:24 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.