Sending email with Command Button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following and can't seem to add what I need to it:

Private Sub SendConfirmationEmail_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Dim subject As String
Dim Message As String

If IsNull() Or [Email] = "" Then
MsgBox "There is no E-mail for this Delegate!"
Exit Sub
Else
stLinkCriteria = Me![Email]
stsubject = "Registration Confirmation"
stMessageText = "this is a test"
DoCmd.SendObject acSendNoObject, , , stLinkCriteria, , , stsubject,
stMessageText
End If
End Sub

What I need is:
1) Bcc (I have tried every variation... obviously I don't understand the
syntax...)
2) How to not get a "Error/Debug" message when the user changes his/her mind
and doesn't send the email

THANK YOU
Val
 
VAL said:
I have the following and can't seem to add what I need to it:

Private Sub SendConfirmationEmail_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Dim subject As String
Dim Message As String

If IsNull() Or [Email] = "" Then
MsgBox "There is no E-mail for this Delegate!"
Exit Sub
Else
stLinkCriteria = Me![Email]
stsubject = "Registration Confirmation"
stMessageText = "this is a test"
DoCmd.SendObject acSendNoObject, , , stLinkCriteria, , ,
stsubject, stMessageText
End If
End Sub

What I need is:
1) Bcc (I have tried every variation... obviously I don't understand
the syntax...)
2) How to not get a "Error/Debug" message when the user changes
his/her mind and doesn't send the email

THANK YOU
Val[/QUOTE]

The Bcc value is two "comma positions" to the right of where you are using
stLinkCriteria. Whatever test you put in that argument will be used as the Bcc.

For the latter you need an error trap that ignores error number 2501.

On Error GoTo ErrHandler

(your Email code )

Egress:
Exit Sub

ErrHandler:
Select Case Err.Number
Case 2501
'ignore
Case Else
(your normal error handling code)
End Select
Resume Egress
End Sub
 
TY. I will try with two commas. I don't know how to incorporate the error
handler routine you sent me in my event. Sorry - very BEGINNER. and what is
(your normal error handling code)? The event below is all I have and it was
copied from someone else's database...


Rick Brandt said:
VAL said:
I have the following and can't seem to add what I need to it:

Private Sub SendConfirmationEmail_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Dim subject As String
Dim Message As String

If IsNull() Or [Email] = "" Then
MsgBox "There is no E-mail for this Delegate!"
Exit Sub
Else
stLinkCriteria = Me![Email]
stsubject = "Registration Confirmation"
stMessageText = "this is a test"
DoCmd.SendObject acSendNoObject, , , stLinkCriteria, , ,
stsubject, stMessageText
End If
End Sub

What I need is:
1) Bcc (I have tried every variation... obviously I don't understand
the syntax...)
2) How to not get a "Error/Debug" message when the user changes
his/her mind and doesn't send the email

THANK YOU
Val[/QUOTE]

The Bcc value is two "comma positions" to the right of where you are using
stLinkCriteria. Whatever test you put in that argument will be used as the Bcc.

For the latter you need an error trap that ignores error number 2501.

On Error GoTo ErrHandler

(your Email code )

Egress:
Exit Sub

ErrHandler:
Select Case Err.Number
Case 2501
'ignore
Case Else
(your normal error handling code)
End Select
Resume Egress
End Sub
[/QUOTE]
 
Put the On Error Goto ErrHandler line immediately after your Dim statements.
Put the rest after your End If statement.

Normal error handling code is:
MsgBox Err.Description,,"Error# " & Err.Number

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com

If you can't get the help you need in the newsgroup, I can help you for a
very reasonable fee. Over 1000 Access users have come to me for help.
Need a month calendar or 7 day calendar? Need appointment scheduling? Need
room reservations scheduling? Need employee work scheduling? Contact me!





VAL said:
TY. I will try with two commas. I don't know how to incorporate the
error
handler routine you sent me in my event. Sorry - very BEGINNER. and what
is
(your normal error handling code)? The event below is all I have and it
was
copied from someone else's database...


Rick Brandt said:
VAL said:
I have the following and can't seem to add what I need to it:

Private Sub SendConfirmationEmail_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Dim subject As String
Dim Message As String

If IsNull() Or [Email] = "" Then
MsgBox "There is no E-mail for this Delegate!"
Exit Sub
Else
stLinkCriteria = Me![Email]
stsubject = "Registration Confirmation"
stMessageText = "this is a test"
DoCmd.SendObject acSendNoObject, , , stLinkCriteria, , ,
stsubject, stMessageText
End If
End Sub

What I need is:
1) Bcc (I have tried every variation... obviously I don't understand
the syntax...)
2) How to not get a "Error/Debug" message when the user changes
his/her mind and doesn't send the email

THANK YOU
Val[/QUOTE]

The Bcc value is two "comma positions" to the right of where you are
using
stLinkCriteria. Whatever test you put in that argument will be used as
the Bcc.

For the latter you need an error trap that ignores error number 2501.

On Error GoTo ErrHandler

(your Email code )

Egress:
Exit Sub

ErrHandler:
Select Case Err.Number
Case 2501
'ignore
Case Else
(your normal error handling code)
End Select
Resume Egress
End Sub
[/QUOTE][/QUOTE]
 
Thank you. I can't affort to pay someone - at the moment - but may have a
few clients for you that I have turned down. Do you have a company name?
Where about are you located? Can this help all be done by email only? I am
thinking of one client in particular where they have a database already built
but their programmer is no longer available. They want the program revamped
and explained to them. The program is solely to record and manage project
timesheets. The best I could do for them was to improve the look of the
database which is terrible but reprogramming it was out of my league.

PC Datasheet said:
Put the On Error Goto ErrHandler line immediately after your Dim statements.
Put the rest after your End If statement.

Normal error handling code is:
MsgBox Err.Description,,"Error# " & Err.Number

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com

If you can't get the help you need in the newsgroup, I can help you for a
very reasonable fee. Over 1000 Access users have come to me for help.
Need a month calendar or 7 day calendar? Need appointment scheduling? Need
room reservations scheduling? Need employee work scheduling? Contact me!





VAL said:
TY. I will try with two commas. I don't know how to incorporate the
error
handler routine you sent me in my event. Sorry - very BEGINNER. and what
is
(your normal error handling code)? The event below is all I have and it
was
copied from someone else's database...


Rick Brandt said:
VAL wrote:
I have the following and can't seem to add what I need to it:

Private Sub SendConfirmationEmail_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Dim subject As String
Dim Message As String

If IsNull() Or [Email] = "" Then
MsgBox "There is no E-mail for this Delegate!"
Exit Sub
Else
stLinkCriteria = Me![Email]
stsubject = "Registration Confirmation"
stMessageText = "this is a test"
DoCmd.SendObject acSendNoObject, , , stLinkCriteria, , ,
stsubject, stMessageText
End If
End Sub

What I need is:
1) Bcc (I have tried every variation... obviously I don't understand
the syntax...)
2) How to not get a "Error/Debug" message when the user changes
his/her mind and doesn't send the email

THANK YOU
Val

The Bcc value is two "comma positions" to the right of where you are
using
stLinkCriteria. Whatever test you put in that argument will be used as
the Bcc.

For the latter you need an error trap that ignores error number 2501.

On Error GoTo ErrHandler

(your Email code )

Egress:
Exit Sub

ErrHandler:
Select Case Err.Number
Case 2501
'ignore
Case Else
(your normal error handling code)
End Select
Resume Egress
End Sub
[/QUOTE][/QUOTE]
[/QUOTE]
 
I am trying this... but it's not working. What is (your email code)?

PC Datasheet said:
Put the On Error Goto ErrHandler line immediately after your Dim statements.
Put the rest after your End If statement.

Normal error handling code is:
MsgBox Err.Description,,"Error# " & Err.Number

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com

If you can't get the help you need in the newsgroup, I can help you for a
very reasonable fee. Over 1000 Access users have come to me for help.
Need a month calendar or 7 day calendar? Need appointment scheduling? Need
room reservations scheduling? Need employee work scheduling? Contact me!





VAL said:
TY. I will try with two commas. I don't know how to incorporate the
error
handler routine you sent me in my event. Sorry - very BEGINNER. and what
is
(your normal error handling code)? The event below is all I have and it
was
copied from someone else's database...


Rick Brandt said:
VAL wrote:
I have the following and can't seem to add what I need to it:

Private Sub SendConfirmationEmail_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Dim subject As String
Dim Message As String

If IsNull() Or [Email] = "" Then
MsgBox "There is no E-mail for this Delegate!"
Exit Sub
Else
stLinkCriteria = Me![Email]
stsubject = "Registration Confirmation"
stMessageText = "this is a test"
DoCmd.SendObject acSendNoObject, , , stLinkCriteria, , ,
stsubject, stMessageText
End If
End Sub

What I need is:
1) Bcc (I have tried every variation... obviously I don't understand
the syntax...)
2) How to not get a "Error/Debug" message when the user changes
his/her mind and doesn't send the email

THANK YOU
Val

The Bcc value is two "comma positions" to the right of where you are
using
stLinkCriteria. Whatever test you put in that argument will be used as
the Bcc.

For the latter you need an error trap that ignores error number 2501.

On Error GoTo ErrHandler

(your Email code )

Egress:
Exit Sub

ErrHandler:
Select Case Err.Number
Case 2501
'ignore
Case Else
(your normal error handling code)
End Select
Resume Egress
End Sub
[/QUOTE][/QUOTE]
[/QUOTE]
 
I would avoid PC Datasheet aka steve santos.
He is a person with very poor business ethics and his only purpose is to
solicit work. From some of his examples, there are far better developers in
these forums who can help for free.

John... Visio MVP
 
"VAL" <[email protected]> schreef in bericht
To the OP: Beware of this guy!!
Everybody is free of course to hire a person like PCDataSheet BUT I would not recommend him !!
He is not a resource at all !!

-- He is asking lots of ignorant questions here under different names because he is ashamed to ask *as* PCD.
-- He is giving lots of wrong or just plain stupid answers here.

Though he thinks he is a resource and advertises as such, he is not really what he thinks he is.
==>> But he is always trying very hard to be very helpful to new people here ...

Steve just does *not* care about the newsgroups. He has *no ethics at all*.
Steve *only* cares about making *money*, and he acts as if the groups are his private hunting ground.

-- He abuses this group and others for job-hunting and advertising over and over again
-- He is insulting lots of people here when they ask him to stop this
-- He posted as Steve, Ron, Tom, Rachel, Kathy, Kristine, Heather and ??? while asking questions
(the latest 'star's': 'Access Resource' and Tom (e-mail address removed) and Andy)
-- He tries to sell a CD ($125,--) with FREE code he gathered from these groups here
-- There even has been a 'Scam-alert' about him which has been explained recently in the thread 'To all':
http://groups.google.com/group/comp.databases.ms-access/msg/46038ba2954261f9?hl=en
-- Also recently it became clear that he has been spamming innocent people asking questions:
http://groups.google.com/group/comp.databases.ms-access/msg/4f76d0ed3e5f58ad?hl=en

So why would ANYBODY ever trust a person like him and hire him?
********************************************************

Explanation and more links on this answer:
http://home.tiscali.nl/arracom/stopsteve.html

Arno R
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top