Solved

After Update SendEMail

Posted on 2012-04-13
6
343 Views
Last Modified: 2012-05-16
Hello Experts:

I have a Main tbl where I am storing a lookup leading to a User tbl. Within the User tbl I am maintaining:

User Name, User E-Mail, Manager & Manager E-Mail

I have set the Main tbl to display all of this information within its lookup, when a record is updated I was hoping to use this to notify the corresponding manager.

In other words, if Bob is the user then Bob's manager Joe would be notified because this relationship is maintained within the User table when a record is updated.

I have tried doing this various ways within the To field of SendEmail but no matter what I try it doesn't work. I typically get an error stating that "User" isn't defined. So =([Users].[ManagerEMail]) doesn't work and I cannot seem to define a path to [ManagerEMail] from the [Users] defined within my Main tbl which I suspect to be my issue. Not sure if there's a syntax to move you through specific columns within a lookup.

I suppose I could just add the manager's e-mail directly to the form that populates the tbl but I'd like to see if there's a way to leverage the existing relationship that already exists within my User tbl.

Any ideas would be much appreciated, thanks.
0
Comment
Question by:ShadowIT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 21
ID: 37842896
It would help to have more detail about the form design.

For this to work you have to someway read the information from the user table.  There are several ways to handle this. If you have the userID, you could use the DLookup() function to retrieve the email address.   If ther is a combo box on the for for selcting user then yu coudl add the email as a hidden column and reference it as needed.
0
 

Author Comment

by:ShadowIT
ID: 37842985
Thanks for your reply, actually this wouldn't be dependant on any form.  Although I do have a form that enters records into the main tbl; instead this would be based on the record state within the main tbl being updated.  

I can accomplish this by hardcoding an e-mail address with SendEmail macro as an AfterUpdate event, but I am looking to pulling this dymanically from my User tbl.

I can't do a DLookup() as this is a web database and I'm only able to use macros, no code allowed.  I was able to find a Lookup macro, perhaps this would work?  Unfortunately I am not sure of the syntax I should be using in the Where section.  Then I'd also need to know how to relate this back to the SendEMail macro.
0
 
LVL 31

Expert Comment

by:Helen Feddema
ID: 37843851
Try saving the Manager Email to a String variable, and using that in your code.
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 21
ID: 37843982
Ah ... I missed that this was a web database. This new site skin is really hard to see. Still trying to get used to it.

I have not had any need for the web database feature of 2010.  

I did a little research and these may help:

http://www.access-programmers.co.uk/forums/showthread.php?t=196662

http://www.utteraccess.com/forum/Tempvar-Change-T-t1962140.html

FWIW: The AccessJunkie that has replied in the above links works on the Access Product Group at Microsoft.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 37854214
This is the downside of using "web" databases...
You only have macros.
You can't automate these database in the same way as you can a standard Access db.

You may want to look into a product like this:
http://eqldata.com/index/
0
 

Author Closing Comment

by:ShadowIT
ID: 37977319
Perfect!
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question