Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Email Help on Defaulting to Email Address
Nilsen Septon 
   
14 months ago
I'm building an email option as shown in the 'CDO' series (https://599cd.com/blog/display-article.asp?ID=3325) and it works great....with one exception.

I'm storing email addresses in an EmailT and then on my Individual Contact Form (IndF), I have buttons to click to display 'Email', 'Phone', 'Relationships' and such. While initially the Individual Email Form (IndEmailF) was a subform on the IndF, It is now an 'Object' (IndSF) on the IndF, and the buttons control what to display (onclick - IndSF.SourceObject = "IndEmailF".

I know typically getting a value from a form would be =Forms!IndEmailF!EmailAddress but when I do that (in Default Value), I get #Name?

I could type in an email and the process worked, but I can't get an email to default. I also tried a combo box - that worked in allowing the user to select an email, but the email process failed saying that at least one recipient needs to be selected. Thoughts??
Nilsen Septon OP  @Reply  
   
14 months ago
Quick update...since I'm currently using =Forms!IndEmailF!EmailAddress as the default value for the 'To' email field, I just realized that the code only works with an 'open' form, and IndEmailF is not open (remember, the subform in the IndF parent form is now a source object and clicking on buttons dictate what will be displayed in that object).

So I opened the IndEmailF form and then clicked on my Email button, and the 'To' field populates....but only with the first value in the form. So clearly, the =Forms!IndEmailF!EmailAddress code is not correct for what I want to do.
Kevin Robertson  @Reply  
          
14 months ago
Use DLookup to look up the value directly from the Table.
Remember to wrap it with the NZ Function to prevent an error if there is no value.
Nilsen Septon OP  @Reply  
   
14 months ago
Thanks Kevin - I got that to work except now I just need it to pull the 'primary' (isprimary = true) address (I have the EmailT with a Yes/No as 'isprimay', default to true, and code where there can only be one address as primary). I know with the DLookup I have the field,table,criteria....=DLookUp("EmailAddress","EmailT","IndID=" & NZ(IndID,0))....and I tried putting an...And isprimary = true...but that didn't work
Kevin Robertson  @Reply  
          
14 months ago
Try this:

=Nz(DLookUp("EmailAddress","EmailT","IndID=" & IndID & " And IsPrimary=True"),"")
Nilsen Septon OP  @Reply  
   
14 months ago
You're the Man Kevin - that works! Very Much appreciate the help!!

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/16/2026 2:57:52 PM. PLT: 1s