Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 384
  • Last Modified:

Querying for an email address in a simple database

I am new to Access and have always wanted to learn it. I usually learn from getting something that already exists and taking it apart and seeing how it works. I downloaded a simple call center template from the MS site (http://office.microsoft.com/en-us/templates/TC102068791033.aspx?CategoryID=CT101428241033&av=ZAC000) I have changed everything around to where I like it, but when I want to send an email to the client it sends the email to the tech and not the client. I can't figure out why I can't get it to go find the emails address that goes with the customer. Here is the line that I am working with.

To:  =DLookUp("[E-mail Address]","Customers","[ID]=" & Nz([E-mail Address],0))

Any recommendations on what I can change to make it work would be appreciated.
0
timamartin
Asked:
timamartin
  • 5
  • 3
1 Solution
 
timamartinAuthor Commented:
I think the part that makes this more difficult is that the customer email address is not actually shown on the form, but is stored in the customer info.
0
 
timamartinAuthor Commented:
It should be something like this I believe...

DLookup("(E-mail Address)","Customers","First Name" + " " + Last Name="Caller")
0
 
Jeffrey CoachmanMIS LiasonCommented:

Try this:


DLookup("[E-mail Address]","[Customers]","[First Name]" & " " & [Last Name]=" & "'" & Caller & "'")

Open in new window

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Jeffrey CoachmanMIS LiasonCommented:
OK,

If you are using the template faithfully, the syntax will be this:
DLookup("[E-mail Address]", "[Customers]", "ID=" & Caller)

Open in new window

0
 
timamartinAuthor Commented:
OK I am back at it. Here is my current attempt

=DLookUp("E-mail Address","Customers","ID = " & [Forms]![Call Details]![Caller])

I am trying to find the "E-mail Address" in the "Customers" table for the "ID" that is currently being displayed in the form. The "Caller" field returns the customer ID for the record currently displayed on the screen "Call Details"
snap01015.jpg
snap01014.jpg
0
 
timamartinAuthor Commented:
Whoops I didn't notice the last post from Boaq. When I cut and past exactly what you have into the To field I get the error "Microsoft Access cannot parse the expression...
0
 
timamartinAuthor Commented:
Here is another attempt - I can't figure out why none of these are working...

=DLookUp("E-mail Address","Customers","ID = '" & Forms!"Call Details"!Caller & "'")

0
 
Jeffrey CoachmanMIS LiasonCommented:
timamartin,

Part of the issue here is that you are using sapces in your object names.
Please try to avoid doing this, and adapt a standard naming convention for your objects:
http://en.wikipedia.org/wiki/Leszynski_naming_convention
Or...
http://www.xoc.net/standards/rvbanc.asp

Try putting square brackets around "E-Mail Address" (and now "Call Details") as I have shown in both of my posts.

(I really don'k know where your last formula came from?)

Something like this:
=DLookUp("[E-mail Address]","Customers","ID ="  & Forms![Call Details]!Caller)

If this does not work, then post a sample of your database please.

JeffCoachman



0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now