Solved

After Update SendEMail

Posted on 2012-04-13
6
338 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
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

759 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now