473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Email automation [Me!Field]

I'm trying to embed the value of a combo box into my email body text
string. Any clues as to how I can adjust my syntax as this gives
compile error:

Private Sub Email_Click()
DoCmd.SendObject_ acSendNoObject, , ,_
"Da*********@abcde.com", , ,_
"Database maintenance notice",_
"I will need to shut down the" [Me!ComboEmailDB] "database from to
today." , , _
False
End Sub

'thus it needs to read "I will need to shut the RECEIVABLES database
down from to today."

Thanks for any clues!

Apr 19 '06 #1
5 1473
Clue: :-)

You need to change this part:
"I will need to shut down the" [Me!ComboEmailDB] "database from

to:
"I will need to shut down the" & Me!ComboEmailDB & " database from

What's different:
1. The & sign strings together the text between your quotes and the
value of the field on your form. Note that I've added a space before
the word database. Otherwise, the value of your field will be run
together with the subsequent text, leaving you with RECEIVABLESdatabase
instead of RECEIVABLES database.
2. You don't want a bracket around the entire field name. The only
time you should need to use a bracket on a field name is if it has
spaces or special characters in the field name. So if your field name
was Combo Email DB, you'd need to do this to reference it:
Me![Combo Email DB].
If you really LIKE the brackets but don't need them, you can do it like
this:
Me![ComboEmailDB].

hth,
Jana

Apr 19 '06 #2
Thanks, it works fine. One more item puzzles me: I have a table that
has about 20 different departments within our company. Each department
has from 5-10 email recipients. For example one row has "Quality
Assurance" in the field called "Departments" and three email addresses
stored as a long string (under 255 of course)
"Be*********@Arcturus.com, Ev**********@Arcturus.com,
To*******@Arcturus.com" in the field called "EmailAddresses". I have a
combobox (Me!ComboAddresses) on a form from which I choose "Quality
Assurance" and want that to populate the "Recipient" from the email
command string:

DoCmd.SendObject acSendNoObject, , , " & Me!ComboAddresses & ", , ,
"Database maintenance notice - """ & Me!ComboEmailDB & """ database",
_
"I will need to shut down the """ & Me!ComboEmailDB & """ database from
to today." & Chr(13) & _
"I will send a separate Email notification to confirm that it is OK to
sign back on." & Chr(13) & Chr(13) & _
"" & Chr(13) & _
"Thanks!", , _
False

I tried this and got ... & Me!ComboAddresses & ... as a literal in
the recipients when what I wanted to see was the
"Be*********@Arcturus.com, Ev**********@Arcturus.com,
To*******@Arcturus.com" string.

Of course "Me!ComboAddresses" will also need to be rewritten to pull
the second column from the table which is the "EmailAddresses".

Thanks again for any clues!
Dave

Apr 20 '06 #3
You will have to use the doulbe/triple quots to bracket the " &
Me!ComboAddresses & "

As it stands right now you have simply created a literal with ' &
Me!ComboAddresses &' as the body of the literal.

Apr 20 '06 #4
Tried some variations of " "" """ [ ]. etc. None seemed to work. Still
got either a literal or an erro.

Apr 20 '06 #5
Change this line to:
DoCmd.SendObject acSendNoObject, , , Me!ComboAddresses, , ,

Also, it is usually easier to use Chr(34) anywhere you need a ", rather
than trying to muddle through the double/triple quote thingy. So, if
you want a line like this:
I will need to shut down the "RECEIVABLES" database.
Do this (all on one line):
"I will need to shut down the " & Chr(34) & Me!ComboEmailDB & Chr(34)
& " database."

If you need to refer to a particular column of a combo box, use the
Column property, like this:
Me!ComboAddresses.Column(1)
Replace the 1 with the desired column number, but the first column is
column 0, not column 1. So, if your addresses are in the 2nd column of
your combo box, the above line would get the correct data for you.
HTH,
Jana

Apr 20 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: qwweeeit | last post by:
Hi all, Elliot Temple on the 1 June wrote: > How do I make Python press a button on a webpage? I looked at > urllib, but I only see how to open a URL with that. I searched > google but no...
2
by: Ronny Sigo | last post by:
Hello all, I am trying to send email via Access. When performing this below routine the program stops at what I called the P R O B L E M L I N E. I have Microsoft Outlook as the default...
25
by: Neil Ginsberg | last post by:
I have a strange situation with my Access 2000 database. I have code in the database which has worked fine for years, and now all of a sudden doesn't work fine on one or two of my client's...
1
by: Jimmer | last post by:
I've got what should be an easy automation problem, but the solution simply isn't coming to me. I've got several public variables set up for automation as follows: Public gappExcel As...
1
by: Lee Seung Hoo | last post by:
hi~ :) I need all information of "Automation" or "Automation Object" what is that ? why is it useful ? How can I use that by C# or .Net Framework ?
12
by: Tomas | last post by:
Hi, I have worked with VB.NET for half a year (semi-newbie). Currently I am looking around for some books for those that crossed the starting hurdle. There are too many books out there-make...
0
by: Sharath | last post by:
Quality Globe is Glad to Offer you the Fast Track course on Automation, QTP Basics and Advanced, and Quality Center Starting Date: June 4th, 2007 Timings: 10 AM to 3:30 PM Duration: 50 Hours ...
0
by: Sharath | last post by:
"Inspired" by the huge success of our first two automation fast track batches We are forced to start third fast track automation batch ...
0
by: Sharath | last post by:
We are glad to inform you that "Inspired" by the huge success of our first three automation fast track batches We are forced to start fourth fast track automation batch ...
0
by: Sharath | last post by:
We are glad to inform you that "Inspired" by the huge success of our first four automation fast track batches We are forced to start fifth fast track automation batch ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.