473,765 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I display a control value in email subject sent from Access

I've got the following code on the "OnClick" event for a command
button on a form.
_______________ _______________ ________
Private Sub EmailNotify_Cli ck()

DoCmd.SendObjec t acSendNoObject, , , "us**@company.c om", CCFIELD,
BCCFIELD, [LogID], BODY_HERE, False

End Sub
_______________ _______________ ________

It works great, but what I want it to do is include the words "New
Order Entered: Log # " before the [LogID] value in the email subject
line. What do I need to do to make it accept that? I can enter the
phrase, but then the [LogID] doesn't display when in quotes, and
causes a failure of the code if it is outside the quotes.

I'm sure this is simple and obvious, but I'm not having any luck. Any
help is greatly appreciated.

RJB

Feb 9 '07 #1
2 1607
gweasel wrote:
I've got the following code on the "OnClick" event for a command
button on a form.
_______________ _______________ ________
Private Sub EmailNotify_Cli ck()

DoCmd.SendObjec t acSendNoObject, , , "us**@company.c om", CCFIELD,
BCCFIELD, [LogID], BODY_HERE, False

End Sub
_______________ _______________ ________

It works great, but what I want it to do is include the words "New
Order Entered: Log # " before the [LogID] value in the email subject
line. What do I need to do to make it accept that? I can enter the
phrase, but then the [LogID] doesn't display when in quotes, and
causes a failure of the code if it is outside the quotes.

I'm sure this is simple and obvious, but I'm not having any luck. Any
help is greatly appreciated.

RJB
DoCmd.SendObjec t acSendNoObject, , , "us**@company.c om", CCFIELD,
BCCFIELD, "New Order Entered: Log # " & [LogID], BODY_HERE, False
Feb 9 '07 #2
Thanks - works great. I knew it was something simple...darn
ampersands.

On Feb 9, 12:17 pm, salad <o...@vinegar.c omwrote:
gweasel wrote:
I've got the following code on the "OnClick" event for a command
button on a form.
_______________ _______________ ________
Private Sub EmailNotify_Cli ck()
DoCmd.SendObjec t acSendNoObject, , , "u...@company.c om", CCFIELD,
BCCFIELD, [LogID], BODY_HERE, False
End Sub
_______________ _______________ ________
It works great, but what I want it to do is include the words "New
Order Entered: Log # " before the [LogID] value in the email subject
line. What do I need to do to make it accept that? I can enter the
phrase, but then the [LogID] doesn't display when in quotes, and
causes a failure of the code if it is outside the quotes.
I'm sure this is simple and obvious, but I'm not having any luck. Any
help is greatly appreciated.
RJB

DoCmd.SendObjec t acSendNoObject, , , "u...@company.c om", CCFIELD,
BCCFIELD, "New Order Entered: Log # " & [LogID], BODY_HERE, False

Feb 9 '07 #3

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

Similar topics

6
2434
by: dale zhang | last post by:
Hi, I build a web form with a 4-cell table on the top (flawlayout), followed by some labels and textboxes (gridlayout). The web form is displayed well in dell m60 laptop with all resolution options and DPI options. However when I tried to run it in a dell P3 desktop, labels and textboxes overlapped each other and they were in table area too. Any suggestions? Do I have to put all controls in table cells?
3
5919
by: Marauderz | last post by:
Hello guys, got a little question regarding the regional language settings . Anyway I got a Windows 2003 Server machine that was installed with the date format "dd/MM/yyyy" and location still locked in US. As we migrated certain apps over to the new machine. we found out something... someone coded a Now.ToString in a database query... and the SQL Box is running MM/dd/yyyy! Chaos follows!!! I tried setting the Administrator account's...
7
2705
by: Chuck Hartman | last post by:
I have a Windows service that requests web pages from a site using an HttpWebRequest object. When I try to request a page from an ASP.NET 2 site, I get a WebException with message "The remote server returned an error: (500) Internal Server Error." I found a post that suggested to catch the WebException to retrieve the actual HttpWebResponse object for more information. The response returned is shown below. At first I thought this was a...
5
5991
by: Nathan Sokalski | last post by:
I have a user control that contains three variables which are accessed through public properties. They are declared immediately below the "Web Form Designer Generated Code" section. Every time an event is fired by one of the controls contained in the User Control, these variable are reset. Here is my current code (I have a little more to add later, right now I am just concerned about the variables getting reset): Public Class DatePicker2...
1
2704
by: Evan Kontos | last post by:
I have the need to test for the value of a client variable from a server control in a VB Web form. How can I do this in VB. Net? Evan Kontos | EKontos@comtekcadd.com 27 Whitehall St. | 3rd Floor | New York, NY 10004 Tel 212.480.8166 | Fax 212.480.8167 | Personal Fax 786.513.0295 www.comtekcadd.com *** Sent via Developersdex http://www.developersdex.com ***
4
2738
by: rszebras | last post by:
I inherited a database (as a novice at Access) and need to modify it to make it more efficient, i.e., the assignment form needs to autopopulate with the client's name, address, phone number, etc., when you select the cust id. Found this cited as a good method: http://www.mvps.org/access/forms/frm0058.htm I have two tables (clients, assignments) and one form (assignment input) in the database. I have a control box called CUST ID in the...
3
2845
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
I have a asp.net app, in the page there is a scan activex which could scan and save a jpg file in client harddisk. How could we access and display this jpg file on the fly using js in the client IE? Thanks, -Billy zhang
3
5275
by: Allen Chen [MSFT] | last post by:
Hi Richard, Quote from Richard================================================== However I also want to be able to remove the panes. I have tried to include this, but find that when I first add the pane the remove event does not get handled, though thereafter it is handled without problems. ==================================================
14
4361
by: confusedfusion | last post by:
Not sure how many form submissions that have been lost over the years before I started but the company has a contact form that the required fields when validation fails the error message is going into the URL string on a refresh of the form page. I am very green on CF and CFM files and have this code below; I need to help for the error messages to "pop up" in a new window or display on the body of the page so anyone filling out the form knows...
0
9568
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10164
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5277
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.