PC Review


Reply
Thread Tools Rate Thread

Creating a Email Button

 
 
=?Utf-8?B?U2hlcmlh?=
Guest
Posts: n/a
 
      13th Feb 2006
Hi, I am having a problem with my email request button that I added to my
subform. I am creating a database for our customer service team and one of
the functions that they need is a Email Button. So i created an Email Request
button, the problem that i am running across is when I am inputting
information into a clients account and i want to send that account, i press
the email request button but instead of sending just that one account all the
accounts are being sent through the email system. When i first started
working on this database i had the email button working when it was just on a
form, but when i updated the database and created a sub form the email
request button will not send one client. If someone could lend me a helping
hand it would be great appreciated. Below is a copy of the program

Function Email_frmInsReq()

'Emails form results to A-Team Staff

On Error GoTo Email_frmInsReq_Err
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.SendObject acSendForm, "subfrmInsReq", acFormatHTML, , , , _
"Self Pay Database Request", "This is an automated e-mail message
created by the Self Pay Database." _
, False

Email_frmInsReq_Exit:

Exit Function

Email_frmInsReq_Err:

Thanks you
Sheria
MsgBox Error$
Resume Email_frmInsReq_Exit

End Function
 
Reply With Quote
 
 
 
 
=?Utf-8?B?bGRpYXo=?=
Guest
Posts: n/a
 
      13th Feb 2006
I'm using this code for my DataBase, if you understand it will help you..if
you have another question please reply.


Private Sub EMailRptBtn_Click()


On Error GoTo ErrHandler

Dim rpt As Report
Dim sRptName As String
Dim sMsg As String
Dim stdomail As String

sRptName = "rptSingleOrder"
sMsg = "Please confirm if this Order Quotation is correct with " & _
"Product Name, Descripción & price!!"
stdomail = Me![SupplierID].Column(2) 'This column has the e-mail address

DoCmd.OpenReport sRptName, acViewDesign
Set rpt = Reports(sRptName)

rpt.RecordSource = "SELECT * " & _
"FROM [OrdersQueryInvoice1] " & _
"WHERE (OrderID = " & Me!OrderID.Value & ");"

DoCmd.Close acReport, sRptName, acSaveYes

DoCmd.SendObject acSendReport, sRptName, acFormatSNP, _
stdomail, , , "Order Quotation", sMsg, True

CleanUp:

Set rpt = Nothing

Exit Sub

ErrHandler:

If (Err.Number <> 2501 And Err.Number <> 2046) Then ' User didn't
cancel E-Mail.
MsgBox "Error in EMailRptBtn_Click( ) in" & vbCrLf & _
Me.Name & " form." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & vbCrLf & Err.Description
End If

Err.Clear
GoTo CleanUp



End Sub



--
Lorenzo DÃ*az
Cad Technician


"Sheria" wrote:

> Hi, I am having a problem with my email request button that I added to my
> subform. I am creating a database for our customer service team and one of
> the functions that they need is a Email Button. So i created an Email Request
> button, the problem that i am running across is when I am inputting
> information into a clients account and i want to send that account, i press
> the email request button but instead of sending just that one account all the
> accounts are being sent through the email system. When i first started
> working on this database i had the email button working when it was just on a
> form, but when i updated the database and created a sub form the email
> request button will not send one client. If someone could lend me a helping
> hand it would be great appreciated. Below is a copy of the program
>
> Function Email_frmInsReq()
>
> 'Emails form results to A-Team Staff
>
> On Error GoTo Email_frmInsReq_Err
> DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
> DoCmd.SendObject acSendForm, "subfrmInsReq", acFormatHTML, , , , _
> "Self Pay Database Request", "This is an automated e-mail message
> created by the Self Pay Database." _
> , False
>
> Email_frmInsReq_Exit:
>
> Exit Function
>
> Email_frmInsReq_Err:
>
> Thanks you
> Sheria
> MsgBox Error$
> Resume Email_frmInsReq_Exit
>
> End Function

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a 'Submit' button with in an excel form that will email f =?Utf-8?B?a3V5YQ==?= Microsoft Excel Programming 1 4th May 2007 01:17 AM
creating an email with a command button Meryl Microsoft Access Form Coding 1 3rd Nov 2004 05:30 PM
Creating Command Bar Button/Poppu like the 'Send' button =?Utf-8?B?Qkc=?= Microsoft Outlook VBA Programming 0 21st Sep 2004 11:41 PM
Creating Command Bar Button/Poppu like the 'Send' button =?Utf-8?B?Qkc=?= Microsoft Outlook Program Addins 0 21st Sep 2004 11:33 PM
Creating VBA button to send an email Todd Huttenstine Microsoft Excel Worksheet Functions 4 12th Sep 2003 11:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:43 PM.