Sending report by E-mail but with criteria or filter

G

Guest

Hi all..
I want to send a report but this function pull all Orders reports and I want
just one accordings the Orders Form is opened,
I have something similary in the Print Function to print the same report,
but with this I don't have the problem because it's filtered by a Query with
criteria, but to send individual Orders reports , I don't know how? Could
anybody help me on this please.

Thanks.
Ldiaz


""""here is the code that I have....
____________________________________________________________
Private Sub mail_Click()
On Error GoTo Err_mail_Click

Dim stDocName As String
Dim stdomail As String


stDocName = "Orders" 'Report name
stdomail = Me![SupplierID].Column(2) 'This column has the e-mail address
DoCmd.SendObject acReport, stDocName, , stdomail, , , "Order Quotation",
"Please confirm if this Order Quotation is correct with Product
Name,Descripción & price!!"


Exit_mail_Click:
Exit Sub

Err_mail_Click:
MsgBox Err.Description
Resume Exit_mail_Click

End Sub
_______________________________________________________
 
G

Guest

Make a copy of your "Orders" report and name this copy "rptSingleOrder"
because you are going to be making modifications to it programmatically, and
you'll probably want to keep the original. Next, look at the
rptSingleOrder's Record Source Property to find the query or table that's
used as the record source. In the example below, I've used qryOrders, but
you'll need to replace this name with your report's Record Source Property.
Next, create a button on your Orders form and paste the following code in the
form's module:

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 qryOrders " & _
"WHERE (OrderID = " & Me!txtOrderID.Value & ");"
DoCmd.Close acReport, sRptName, acSaveYes

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

CleanUp:

Set rpt = Nothing

Exit Sub

ErrHandler:

If (Err.Number <> 2501) 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 ' EMailRptBtn_Click( )

.. . . where EMailRptBtn is the name of the button, rptSingleOrder is the
name of the report that gets modified and sent as a snapshot to the
recipient, SupplierID is the combo box that holds the E-Mail address,
qryOrders is the data source for the orders, OrderID is the primary key for
the data source, and txtOrderID is the text box that displays the OrderID.

Save and compile the code, then return to the form and open it in Form View.
Select the record to send the report to the recipient on the form, then
select the EMailRptBtn to send it off without editing it. If you want to
edit the E-mail before sending it, then change the last argument in the
SendObject method to TRUE. If you want a different format than the snapshot
format, then change acFormatSNP to a different format.

And remember that SendObject can be buggy, especially when used in loops.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


ldiaz said:
Hi all..
I want to send a report but this function pull all Orders reports and I want
just one accordings the Orders Form is opened,
I have something similary in the Print Function to print the same report,
but with this I don't have the problem because it's filtered by a Query with
criteria, but to send individual Orders reports , I don't know how? Could
anybody help me on this please.

Thanks.
Ldiaz


""""here is the code that I have....
____________________________________________________________
Private Sub mail_Click()
On Error GoTo Err_mail_Click

Dim stDocName As String
Dim stdomail As String


stDocName = "Orders" 'Report name
stdomail = Me![SupplierID].Column(2) 'This column has the e-mail address
DoCmd.SendObject acReport, stDocName, , stdomail, , , "Order Quotation",
"Please confirm if this Order Quotation is correct with Product
Name,Descripción & price!!"


Exit_mail_Click:
Exit Sub

Err_mail_Click:
MsgBox Err.Description
Resume Exit_mail_Click

End Sub
_______________________________________________________
 
G

Guest

application.Echo

Docmd.OpenReport sRptName,,"where Invoice = '101'"

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

The report is open in preview mode before I sent it.

(david)
 
G

Guest

Hi camaro...I used your code but appear an error message that says:

Error #3131
Syntax error in FROM clause

my query name is:Orders Query Invoice
my form Name is "Orders" where I put the button
my primary key is OrderID and it has the same name of text box.

could you help me to fx this, I'm sure it work but I have a little problem.

Thanks for your help..

Ldiaz


'69 Camaro said:
Make a copy of your "Orders" report and name this copy "rptSingleOrder"
because you are going to be making modifications to it programmatically, and
you'll probably want to keep the original. Next, look at the
rptSingleOrder's Record Source Property to find the query or table that's
used as the record source. In the example below, I've used qryOrders, but
you'll need to replace this name with your report's Record Source Property.
Next, create a button on your Orders form and paste the following code in the
form's module:

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 qryOrders " & _
"WHERE (OrderID = " & Me!txtOrderID.Value & ");"
DoCmd.Close acReport, sRptName, acSaveYes

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

CleanUp:

Set rpt = Nothing

Exit Sub

ErrHandler:

If (Err.Number <> 2501) 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 ' EMailRptBtn_Click( )

. . . where EMailRptBtn is the name of the button, rptSingleOrder is the
name of the report that gets modified and sent as a snapshot to the
recipient, SupplierID is the combo box that holds the E-Mail address,
qryOrders is the data source for the orders, OrderID is the primary key for
the data source, and txtOrderID is the text box that displays the OrderID.

Save and compile the code, then return to the form and open it in Form View.
Select the record to send the report to the recipient on the form, then
select the EMailRptBtn to send it off without editing it. If you want to
edit the E-mail before sending it, then change the last argument in the
SendObject method to TRUE. If you want a different format than the snapshot
format, then change acFormatSNP to a different format.

And remember that SendObject can be buggy, especially when used in loops.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


ldiaz said:
Hi all..
I want to send a report but this function pull all Orders reports and I want
just one accordings the Orders Form is opened,
I have something similary in the Print Function to print the same report,
but with this I don't have the problem because it's filtered by a Query with
criteria, but to send individual Orders reports , I don't know how? Could
anybody help me on this please.

Thanks.
Ldiaz


""""here is the code that I have....
____________________________________________________________
Private Sub mail_Click()
On Error GoTo Err_mail_Click

Dim stDocName As String
Dim stdomail As String


stDocName = "Orders" 'Report name
stdomail = Me![SupplierID].Column(2) 'This column has the e-mail address
DoCmd.SendObject acReport, stDocName, , stdomail, , , "Order Quotation",
"Please confirm if this Order Quotation is correct with Product
Name,Descripción & price!!"


Exit_mail_Click:
Exit Sub

Err_mail_Click:
MsgBox Err.Description
Resume Exit_mail_Click

End Sub
_______________________________________________________
 
G

Guest

could you help me to fx this

Sure. You have illegal characters in the name of the query. Spaces aren't
allowed. However, Jet often lets one "fix" these illegal characters if one
puts brackets around a multiple-worded name. For example:

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

There's no guarantee that illegal characters that are bracketed will work in
every situation. Only use alphanumeric characters and the underscore
character when naming any object (that includes tables and fields),
procedure, or variable, and you will avoid many, many bugs.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


ldiaz said:
Hi camaro...I used your code but appear an error message that says:

Error #3131
Syntax error in FROM clause

my query name is:Orders Query Invoice
my form Name is "Orders" where I put the button
my primary key is OrderID and it has the same name of text box.

could you help me to fx this, I'm sure it work but I have a little problem.

Thanks for your help..

Ldiaz


'69 Camaro said:
Make a copy of your "Orders" report and name this copy "rptSingleOrder"
because you are going to be making modifications to it programmatically, and
you'll probably want to keep the original. Next, look at the
rptSingleOrder's Record Source Property to find the query or table that's
used as the record source. In the example below, I've used qryOrders, but
you'll need to replace this name with your report's Record Source Property.
Next, create a button on your Orders form and paste the following code in the
form's module:

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 qryOrders " & _
"WHERE (OrderID = " & Me!txtOrderID.Value & ");"
DoCmd.Close acReport, sRptName, acSaveYes

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

CleanUp:

Set rpt = Nothing

Exit Sub

ErrHandler:

If (Err.Number <> 2501) 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 ' EMailRptBtn_Click( )

. . . where EMailRptBtn is the name of the button, rptSingleOrder is the
name of the report that gets modified and sent as a snapshot to the
recipient, SupplierID is the combo box that holds the E-Mail address,
qryOrders is the data source for the orders, OrderID is the primary key for
the data source, and txtOrderID is the text box that displays the OrderID.

Save and compile the code, then return to the form and open it in Form View.
Select the record to send the report to the recipient on the form, then
select the EMailRptBtn to send it off without editing it. If you want to
edit the E-mail before sending it, then change the last argument in the
SendObject method to TRUE. If you want a different format than the snapshot
format, then change acFormatSNP to a different format.

And remember that SendObject can be buggy, especially when used in loops.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


ldiaz said:
Hi all..
I want to send a report but this function pull all Orders reports and I want
just one accordings the Orders Form is opened,
I have something similary in the Print Function to print the same report,
but with this I don't have the problem because it's filtered by a Query with
criteria, but to send individual Orders reports , I don't know how? Could
anybody help me on this please.

Thanks.
Ldiaz


""""here is the code that I have....
____________________________________________________________
Private Sub mail_Click()
On Error GoTo Err_mail_Click

Dim stDocName As String
Dim stdomail As String


stDocName = "Orders" 'Report name
stdomail = Me![SupplierID].Column(2) 'This column has the e-mail address
DoCmd.SendObject acReport, stDocName, , stdomail, , , "Order Quotation",
"Please confirm if this Order Quotation is correct with Product
Name,Descripción & price!!"


Exit_mail_Click:
Exit Sub

Err_mail_Click:
MsgBox Err.Description
Resume Exit_mail_Click

End Sub
_______________________________________________________
 
G

Guest

Oops. You mentioned "has the same name of text box" and I mistranslated that
to mean the same name as I had given the text box, not the text box with the
same name as your primary key. Try:

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

Sorry for any confusion. And if you want to avoid bugs in the future, don't
accept the default names that Access gives for the controls that are going to
be referenced either in VBA code, as shown above, or as a property. Rename
these controls to something like txtOrderID, which indicates it's a text box
displaying the OrderID field.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


'69 Camaro said:
could you help me to fx this

Sure. You have illegal characters in the name of the query. Spaces aren't
allowed. However, Jet often lets one "fix" these illegal characters if one
puts brackets around a multiple-worded name. For example:

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

There's no guarantee that illegal characters that are bracketed will work in
every situation. Only use alphanumeric characters and the underscore
character when naming any object (that includes tables and fields),
procedure, or variable, and you will avoid many, many bugs.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


ldiaz said:
Hi camaro...I used your code but appear an error message that says:

Error #3131
Syntax error in FROM clause

my query name is:Orders Query Invoice
my form Name is "Orders" where I put the button
my primary key is OrderID and it has the same name of text box.

could you help me to fx this, I'm sure it work but I have a little problem.

Thanks for your help..

Ldiaz


'69 Camaro said:
Make a copy of your "Orders" report and name this copy "rptSingleOrder"
because you are going to be making modifications to it programmatically, and
you'll probably want to keep the original. Next, look at the
rptSingleOrder's Record Source Property to find the query or table that's
used as the record source. In the example below, I've used qryOrders, but
you'll need to replace this name with your report's Record Source Property.
Next, create a button on your Orders form and paste the following code in the
form's module:

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 qryOrders " & _
"WHERE (OrderID = " & Me!txtOrderID.Value & ");"
DoCmd.Close acReport, sRptName, acSaveYes

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

CleanUp:

Set rpt = Nothing

Exit Sub

ErrHandler:

If (Err.Number <> 2501) 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 ' EMailRptBtn_Click( )

. . . where EMailRptBtn is the name of the button, rptSingleOrder is the
name of the report that gets modified and sent as a snapshot to the
recipient, SupplierID is the combo box that holds the E-Mail address,
qryOrders is the data source for the orders, OrderID is the primary key for
the data source, and txtOrderID is the text box that displays the OrderID.

Save and compile the code, then return to the form and open it in Form View.
Select the record to send the report to the recipient on the form, then
select the EMailRptBtn to send it off without editing it. If you want to
edit the E-mail before sending it, then change the last argument in the
SendObject method to TRUE. If you want a different format than the snapshot
format, then change acFormatSNP to a different format.

And remember that SendObject can be buggy, especially when used in loops.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


:

Hi all..
I want to send a report but this function pull all Orders reports and I want
just one accordings the Orders Form is opened,
I have something similary in the Print Function to print the same report,
but with this I don't have the problem because it's filtered by a Query with
criteria, but to send individual Orders reports , I don't know how? Could
anybody help me on this please.

Thanks.
Ldiaz


""""here is the code that I have....
____________________________________________________________
Private Sub mail_Click()
On Error GoTo Err_mail_Click

Dim stDocName As String
Dim stdomail As String


stDocName = "Orders" 'Report name
stdomail = Me![SupplierID].Column(2) 'This column has the e-mail address
DoCmd.SendObject acReport, stDocName, , stdomail, , , "Order Quotation",
"Please confirm if this Order Quotation is correct with Product
Name,Descripción & price!!"


Exit_mail_Click:
Exit Sub

Err_mail_Click:
MsgBox Err.Description
Resume Exit_mail_Click

End Sub
_______________________________________________________
 
G

Guest

Thank you so much camaro for your help, I found that my problem was because I
had OrderID in the form and OrderId in the Subform, I have remove OrderID
from subform and it's working fine righ now..

anyway I want to thank you all your attention to my question.

Best Regards and God bless you.

Thanks.
(e-mail address removed)



'69 Camaro said:
Oops. You mentioned "has the same name of text box" and I mistranslated that
to mean the same name as I had given the text box, not the text box with the
same name as your primary key. Try:

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

Sorry for any confusion. And if you want to avoid bugs in the future, don't
accept the default names that Access gives for the controls that are going to
be referenced either in VBA code, as shown above, or as a property. Rename
these controls to something like txtOrderID, which indicates it's a text box
displaying the OrderID field.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


'69 Camaro said:
could you help me to fx this

Sure. You have illegal characters in the name of the query. Spaces aren't
allowed. However, Jet often lets one "fix" these illegal characters if one
puts brackets around a multiple-worded name. For example:

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

There's no guarantee that illegal characters that are bracketed will work in
every situation. Only use alphanumeric characters and the underscore
character when naming any object (that includes tables and fields),
procedure, or variable, and you will avoid many, many bugs.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


ldiaz said:
Hi camaro...I used your code but appear an error message that says:

Error #3131
Syntax error in FROM clause

my query name is:Orders Query Invoice
my form Name is "Orders" where I put the button
my primary key is OrderID and it has the same name of text box.

could you help me to fx this, I'm sure it work but I have a little problem.

Thanks for your help..

Ldiaz


:

Make a copy of your "Orders" report and name this copy "rptSingleOrder"
because you are going to be making modifications to it programmatically, and
you'll probably want to keep the original. Next, look at the
rptSingleOrder's Record Source Property to find the query or table that's
used as the record source. In the example below, I've used qryOrders, but
you'll need to replace this name with your report's Record Source Property.
Next, create a button on your Orders form and paste the following code in the
form's module:

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 qryOrders " & _
"WHERE (OrderID = " & Me!txtOrderID.Value & ");"
DoCmd.Close acReport, sRptName, acSaveYes

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

CleanUp:

Set rpt = Nothing

Exit Sub

ErrHandler:

If (Err.Number <> 2501) 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 ' EMailRptBtn_Click( )

. . . where EMailRptBtn is the name of the button, rptSingleOrder is the
name of the report that gets modified and sent as a snapshot to the
recipient, SupplierID is the combo box that holds the E-Mail address,
qryOrders is the data source for the orders, OrderID is the primary key for
the data source, and txtOrderID is the text box that displays the OrderID.

Save and compile the code, then return to the form and open it in Form View.
Select the record to send the report to the recipient on the form, then
select the EMailRptBtn to send it off without editing it. If you want to
edit the E-mail before sending it, then change the last argument in the
SendObject method to TRUE. If you want a different format than the snapshot
format, then change acFormatSNP to a different format.

And remember that SendObject can be buggy, especially when used in loops.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.


:

Hi all..
I want to send a report but this function pull all Orders reports and I want
just one accordings the Orders Form is opened,
I have something similary in the Print Function to print the same report,
but with this I don't have the problem because it's filtered by a Query with
criteria, but to send individual Orders reports , I don't know how? Could
anybody help me on this please.

Thanks.
Ldiaz


""""here is the code that I have....
____________________________________________________________
Private Sub mail_Click()
On Error GoTo Err_mail_Click

Dim stDocName As String
Dim stdomail As String


stDocName = "Orders" 'Report name
stdomail = Me![SupplierID].Column(2) 'This column has the e-mail address
DoCmd.SendObject acReport, stDocName, , stdomail, , , "Order Quotation",
"Please confirm if this Order Quotation is correct with Product
Name,Descripción & price!!"


Exit_mail_Click:
Exit Sub

Err_mail_Click:
MsgBox Err.Description
Resume Exit_mail_Click

End Sub
_______________________________________________________
 
6

'69 Camaro

You're very welcome. It appears that you've marked my post above as an
answer to your question. Unfortunately, the Web portal is still rather
buggy and it didn't recognize you as the original poster of the question.
Would you please do me a favor and sign in again to the Microsoft Online
Community with your .Net Passport and try to mark the "Did this post answer
your question?" question on my previous post until a green check mark shows
up? (Refresh the page about a minute later and the green check mark should
appear.)

Thanks! It's greatly appreciated.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.


ldiaz said:
Thank you so much camaro for your help, I found that my problem was
because I
had OrderID in the form and OrderId in the Subform, I have remove OrderID
from subform and it's working fine righ now..

anyway I want to thank you all your attention to my question.

Best Regards and God bless you.

Thanks.
(e-mail address removed)



'69 Camaro said:
Oops. You mentioned "has the same name of text box" and I mistranslated
that
to mean the same name as I had given the text box, not the text box with
the
same name as your primary key. Try:

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

Sorry for any confusion. And if you want to avoid bugs in the future,
don't
accept the default names that Access gives for the controls that are
going to
be referenced either in VBA code, as shown above, or as a property.
Rename
these controls to something like txtOrderID, which indicates it's a text
box
displaying the OrderID field.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message
will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the
question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember
that
questions answered the quickest are often from those who have a history
of
rewarding the contributors who have taken the time to answer questions
correctly.


'69 Camaro said:
could you help me to fx this

Sure. You have illegal characters in the name of the query. Spaces
aren't
allowed. However, Jet often lets one "fix" these illegal characters if
one
puts brackets around a multiple-worded name. For example:

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

There's no guarantee that illegal characters that are bracketed will
work in
every situation. Only use alphanumeric characters and the underscore
character when naming any object (that includes tables and fields),
procedure, or variable, and you will avoid many, many bugs.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message
will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the
question
"Did this post answer your question?" at the bottom of the message,
which
adds your question and the answers to the database of answers.
Remember that
questions answered the quickest are often from those who have a history
of
rewarding the contributors who have taken the time to answer questions
correctly.


:

Hi camaro...I used your code but appear an error message that says:

Error #3131
Syntax error in FROM clause

my query name is:Orders Query Invoice
my form Name is "Orders" where I put the button
my primary key is OrderID and it has the same name of text box.

could you help me to fx this, I'm sure it work but I have a little
problem.

Thanks for your help..

Ldiaz


:

Make a copy of your "Orders" report and name this copy
"rptSingleOrder"
because you are going to be making modifications to it
programmatically, and
you'll probably want to keep the original. Next, look at the
rptSingleOrder's Record Source Property to find the query or table
that's
used as the record source. In the example below, I've used
qryOrders, but
you'll need to replace this name with your report's Record Source
Property.
Next, create a button on your Orders form and paste the following
code in the
form's module:

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 qryOrders " & _
"WHERE (OrderID = " & Me!txtOrderID.Value & ");"
DoCmd.Close acReport, sRptName, acSaveYes

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

CleanUp:

Set rpt = Nothing

Exit Sub

ErrHandler:

If (Err.Number <> 2501) 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 ' EMailRptBtn_Click( )

. . . where EMailRptBtn is the name of the button, rptSingleOrder
is the
name of the report that gets modified and sent as a snapshot to the
recipient, SupplierID is the combo box that holds the E-Mail
address,
qryOrders is the data source for the orders, OrderID is the primary
key for
the data source, and txtOrderID is the text box that displays the
OrderID.

Save and compile the code, then return to the form and open it in
Form View.
Select the record to send the report to the recipient on the form,
then
select the EMailRptBtn to send it off without editing it. If you
want to
edit the E-mail before sending it, then change the last argument in
the
SendObject method to TRUE. If you want a different format than the
snapshot
format, then change acFormatSNP to a different format.

And remember that SendObject can be buggy, especially when used in
loops.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a
message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the
question
"Did this post answer your question?" at the bottom of the message,
which
adds your question and the answers to the database of answers.
Remember that
questions answered the quickest are often from those who have a
history of
rewarding the contributors who have taken the time to answer
questions
correctly.


:

Hi all..
I want to send a report but this function pull all Orders reports
and I want
just one accordings the Orders Form is opened,
I have something similary in the Print Function to print the same
report,
but with this I don't have the problem because it's filtered by a
Query with
criteria, but to send individual Orders reports , I don't know
how? Could
anybody help me on this please.

Thanks.
Ldiaz


""""here is the code that I have....
____________________________________________________________
Private Sub mail_Click()
On Error GoTo Err_mail_Click

Dim stDocName As String
Dim stdomail As String


stDocName = "Orders" 'Report name
stdomail = Me![SupplierID].Column(2) 'This column has the
e-mail address
DoCmd.SendObject acReport, stDocName, , stdomail, , , "Order
Quotation",
"Please confirm if this Order Quotation is correct with Product
Name,Descripción & price!!"


Exit_mail_Click:
Exit Sub

Err_mail_Click:
MsgBox Err.Description
Resume Exit_mail_Click

End Sub
_______________________________________________________
 
G

Guest

Hi Camaro, i found the problem,,
this question was posted from my work computer and I had signed with
different user name, and when I wanted put as an answer it does not recognize
me as the orginal porster,but now these questions are already marked with
green.

Thank you again .

Ldiaz
'69 Camaro said:
You're very welcome. It appears that you've marked my post above as an
answer to your question. Unfortunately, the Web portal is still rather
buggy and it didn't recognize you as the original poster of the question.
Would you please do me a favor and sign in again to the Microsoft Online
Community with your .Net Passport and try to mark the "Did this post answer
your question?" question on my previous post until a green check mark shows
up? (Refresh the page about a minute later and the green check mark should
appear.)

Thanks! It's greatly appreciated.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.


ldiaz said:
Thank you so much camaro for your help, I found that my problem was
because I
had OrderID in the form and OrderId in the Subform, I have remove OrderID
from subform and it's working fine righ now..

anyway I want to thank you all your attention to my question.

Best Regards and God bless you.

Thanks.
(e-mail address removed)



'69 Camaro said:
Oops. You mentioned "has the same name of text box" and I mistranslated
that
to mean the same name as I had given the text box, not the text box with
the
same name as your primary key. Try:

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

Sorry for any confusion. And if you want to avoid bugs in the future,
don't
accept the default names that Access gives for the controls that are
going to
be referenced either in VBA code, as shown above, or as a property.
Rename
these controls to something like txtOrderID, which indicates it's a text
box
displaying the OrderID field.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message
will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the
question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember
that
questions answered the quickest are often from those who have a history
of
rewarding the contributors who have taken the time to answer questions
correctly.


:

could you help me to fx this

Sure. You have illegal characters in the name of the query. Spaces
aren't
allowed. However, Jet often lets one "fix" these illegal characters if
one
puts brackets around a multiple-worded name. For example:

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

There's no guarantee that illegal characters that are bracketed will
work in
every situation. Only use alphanumeric characters and the underscore
character when naming any object (that includes tables and fields),
procedure, or variable, and you will avoid many, many bugs.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message
will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the
question
"Did this post answer your question?" at the bottom of the message,
which
adds your question and the answers to the database of answers.
Remember that
questions answered the quickest are often from those who have a history
of
rewarding the contributors who have taken the time to answer questions
correctly.


:

Hi camaro...I used your code but appear an error message that says:

Error #3131
Syntax error in FROM clause

my query name is:Orders Query Invoice
my form Name is "Orders" where I put the button
my primary key is OrderID and it has the same name of text box.

could you help me to fx this, I'm sure it work but I have a little
problem.

Thanks for your help..

Ldiaz


:

Make a copy of your "Orders" report and name this copy
"rptSingleOrder"
because you are going to be making modifications to it
programmatically, and
you'll probably want to keep the original. Next, look at the
rptSingleOrder's Record Source Property to find the query or table
that's
used as the record source. In the example below, I've used
qryOrders, but
you'll need to replace this name with your report's Record Source
Property.
Next, create a button on your Orders form and paste the following
code in the
form's module:

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 qryOrders " & _
"WHERE (OrderID = " & Me!txtOrderID.Value & ");"
DoCmd.Close acReport, sRptName, acSaveYes

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

CleanUp:

Set rpt = Nothing

Exit Sub

ErrHandler:

If (Err.Number <> 2501) 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 ' EMailRptBtn_Click( )

. . . where EMailRptBtn is the name of the button, rptSingleOrder
is the
name of the report that gets modified and sent as a snapshot to the
recipient, SupplierID is the combo box that holds the E-Mail
address,
qryOrders is the data source for the orders, OrderID is the primary
key for
the data source, and txtOrderID is the text box that displays the
OrderID.

Save and compile the code, then return to the form and open it in
Form View.
Select the record to send the report to the recipient on the form,
then
select the EMailRptBtn to send it off without editing it. If you
want to
edit the E-mail before sending it, then change the last argument in
the
SendObject method to TRUE. If you want a different format than the
snapshot
format, then change acFormatSNP to a different format.

And remember that SendObject can be buggy, especially when used in
loops.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a
message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the
question
"Did this post answer your question?" at the bottom of the message,
which
adds your question and the answers to the database of answers.
Remember that
questions answered the quickest are often from those who have a
history of
rewarding the contributors who have taken the time to answer
questions
correctly.


:

Hi all..
I want to send a report but this function pull all Orders reports
and I want
just one accordings the Orders Form is opened,
I have something similary in the Print Function to print the same
report,
but with this I don't have the problem because it's filtered by a
Query with
criteria, but to send individual Orders reports , I don't know
how? Could
anybody help me on this please.

Thanks.
Ldiaz


""""here is the code that I have....
____________________________________________________________
Private Sub mail_Click()
On Error GoTo Err_mail_Click

Dim stDocName As String
Dim stdomail As String


stDocName = "Orders" 'Report name
stdomail = Me![SupplierID].Column(2) 'This column has the
e-mail address
DoCmd.SendObject acReport, stDocName, , stdomail, , , "Order
Quotation",
"Please confirm if this Order Quotation is correct with Product
Name,Descripción & price!!"


Exit_mail_Click:
Exit Sub

Err_mail_Click:
MsgBox Err.Description
Resume Exit_mail_Click

End Sub
_______________________________________________________
 
6

'69 Camaro

Ah. That explains it. Most of the time when this happens, either the
three-hour time limit has expired when the original poster comes back to
mark an answer, or he's signed in from another Web site, such as MSN.com,
and navigated to the Microsoft Online Community and marks the answer. In
either case, the green check mark won't appear and the contributor won't get
credit, because he's not recognized by the Web Portal as the original poster
of the question.

In any case, thank you very much for marking it again!

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.


ldiaz said:
Hi Camaro, i found the problem,,
this question was posted from my work computer and I had signed with
different user name, and when I wanted put as an answer it does not
recognize
me as the orginal porster,but now these questions are already marked with
green.

Thank you again .

Ldiaz
'69 Camaro said:
You're very welcome. It appears that you've marked my post above as an
answer to your question. Unfortunately, the Web portal is still rather
buggy and it didn't recognize you as the original poster of the question.
Would you please do me a favor and sign in again to the Microsoft Online
Community with your .Net Passport and try to mark the "Did this post
answer
your question?" question on my previous post until a green check mark
shows
up? (Refresh the page about a minute later and the green check mark
should
appear.)

Thanks! It's greatly appreciated.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.


ldiaz said:
Thank you so much camaro for your help, I found that my problem was
because I
had OrderID in the form and OrderId in the Subform, I have remove
OrderID
from subform and it's working fine righ now..

anyway I want to thank you all your attention to my question.

Best Regards and God bless you.

Thanks.
(e-mail address removed)



:

Oops. You mentioned "has the same name of text box" and I
mistranslated
that
to mean the same name as I had given the text box, not the text box
with
the
same name as your primary key. Try:

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

Sorry for any confusion. And if you want to avoid bugs in the future,
don't
accept the default names that Access gives for the controls that are
going to
be referenced either in VBA code, as shown above, or as a property.
Rename
these controls to something like txtOrderID, which indicates it's a
text
box
displaying the OrderID field.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a
message
will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the
question
"Did this post answer your question?" at the bottom of the message,
which
adds your question and the answers to the database of answers.
Remember
that
questions answered the quickest are often from those who have a
history
of
rewarding the contributors who have taken the time to answer questions
correctly.


:

could you help me to fx this

Sure. You have illegal characters in the name of the query. Spaces
aren't
allowed. However, Jet often lets one "fix" these illegal characters
if
one
puts brackets around a multiple-worded name. For example:

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

There's no guarantee that illegal characters that are bracketed will
work in
every situation. Only use alphanumeric characters and the
underscore
character when naming any object (that includes tables and fields),
procedure, or variable, and you will avoid many, many bugs.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a
message
will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the
question
"Did this post answer your question?" at the bottom of the message,
which
adds your question and the answers to the database of answers.
Remember that
questions answered the quickest are often from those who have a
history
of
rewarding the contributors who have taken the time to answer
questions
correctly.


:

Hi camaro...I used your code but appear an error message that
says:

Error #3131
Syntax error in FROM clause

my query name is:Orders Query Invoice
my form Name is "Orders" where I put the button
my primary key is OrderID and it has the same name of text box.

could you help me to fx this, I'm sure it work but I have a little
problem.

Thanks for your help..

Ldiaz


:

Make a copy of your "Orders" report and name this copy
"rptSingleOrder"
because you are going to be making modifications to it
programmatically, and
you'll probably want to keep the original. Next, look at the
rptSingleOrder's Record Source Property to find the query or
table
that's
used as the record source. In the example below, I've used
qryOrders, but
you'll need to replace this name with your report's Record
Source
Property.
Next, create a button on your Orders form and paste the
following
code in the
form's module:

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 qryOrders " & _
"WHERE (OrderID = " & Me!txtOrderID.Value & ");"
DoCmd.Close acReport, sRptName, acSaveYes

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

CleanUp:

Set rpt = Nothing

Exit Sub

ErrHandler:

If (Err.Number <> 2501) 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 ' EMailRptBtn_Click( )

. . . where EMailRptBtn is the name of the button,
rptSingleOrder
is the
name of the report that gets modified and sent as a snapshot to
the
recipient, SupplierID is the combo box that holds the E-Mail
address,
qryOrders is the data source for the orders, OrderID is the
primary
key for
the data source, and txtOrderID is the text box that displays
the
OrderID.

Save and compile the code, then return to the form and open it
in
Form View.
Select the record to send the report to the recipient on the
form,
then
select the EMailRptBtn to send it off without editing it. If
you
want to
edit the E-mail before sending it, then change the last argument
in
the
SendObject method to TRUE. If you want a different format than
the
snapshot
format, then change acFormatSNP to a different format.

And remember that SendObject can be buggy, especially when used
in
loops.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a
message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to
the
question
"Did this post answer your question?" at the bottom of the
message,
which
adds your question and the answers to the database of answers.
Remember that
questions answered the quickest are often from those who have a
history of
rewarding the contributors who have taken the time to answer
questions
correctly.


:

Hi all..
I want to send a report but this function pull all Orders
reports
and I want
just one accordings the Orders Form is opened,
I have something similary in the Print Function to print the
same
report,
but with this I don't have the problem because it's filtered
by a
Query with
criteria, but to send individual Orders reports , I don't know
how? Could
anybody help me on this please.

Thanks.
Ldiaz


""""here is the code that I have....
____________________________________________________________
Private Sub mail_Click()
On Error GoTo Err_mail_Click

Dim stDocName As String
Dim stdomail As String


stDocName = "Orders" 'Report name
stdomail = Me![SupplierID].Column(2) 'This column has the
e-mail address
DoCmd.SendObject acReport, stDocName, , stdomail, , ,
"Order
Quotation",
"Please confirm if this Order Quotation is correct with
Product
Name,Descripción & price!!"


Exit_mail_Click:
Exit Sub

Err_mail_Click:
MsgBox Err.Description
Resume Exit_mail_Click

End Sub
_______________________________________________________
 

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

Top