email current report only

R

Ruth

Hi there

After doing everything the hard way and not having any success, I used the
wizard to create a button to email a report via outlook. I know want to add
the codes so that it emails the current report only (the report that
corresponds to the form that the email button is on.

The code I have is:

Private Sub Email_Report_Click()
On Error GoTo Err_Email_Report_Click

Dim stDocName As String

stDocName = "MorningReport"
DoCmd.SendObject acReport, stDocName

Exit_Email_Report_Click:
Exit Sub

Err_Email_Report_Click:
MsgBox Err.Description
Resume Exit_Email_Report_Click

End Sub
--

The unique field that is on the form and the report is called AIDX.

I will be happy with that, but if possible I would like it to skip the step
where and pop up box appears and you choose which format. I would like it to
default to Rich Text Format.




Thank-you!
Ruth
 
S

Stockwell43

Hi Ruth,

If all you have is one report that you send out every morning, just create a
macro. it will allow you to choose the format, enter a subject title and put
in the address of the person(s) you are senting it to. Save the macro when
finished and in your command button replace the event procedure with the
macro.

Good Luck!
 
T

Tony Toews [MVP]

Ruth said:
After doing everything the hard way and not having any success, I used the
wizard to create a button to email a report via outlook. I know want to add
the codes so that it emails the current report only (the report that
corresponds to the form that the email button is on.

I think what you meant to say was that the report would contain only
the record that is on the form that the user is displaying.

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
R

Ruth

Thank-you for your help, but I don't know what I did wrong as it does not work.

I went to the web site that Tony suggested. I am sorry, but I must be
missing something or mixing things up. I added the code:

Me.Filter = Morning Report![AIDX] & Forms![New Trip Report 1 to 1]![AIDX]
Me.FilterOn = True

To the report in the 'on open'

When I goto the form and click on the email button. The pop-up box to
select a file type comes up, once a selection is made, nothing happens,
Outlook does not even open anymore. What did I do wrong? How do I fix it?
 
S

Stockwell43

For Output Format on your Macro select Rich Text Format. As far as a filter I
don't see one on the macro. Also, that code you have I not necessary for a
pre-existing report unless you are trying to do like Tony mentioned and send
only the information on the current record.

I think we need to find out some information first. Do you have a report
created in Access or are you trying to send ONLY the current record the user
is on? If it's a full report, I gave you explict instruction on how to create
the Macro that you should be 100% successful because access guide you through
the whole thing with no coding. If it's only the current record, I cannot
help you be cause I have never do that before.

Ruth said:
Thank-you for your help, but I don't know what I did wrong as it does not work.

I went to the web site that Tony suggested. I am sorry, but I must be
missing something or mixing things up. I added the code:

Me.Filter = Morning Report![AIDX] & Forms![New Trip Report 1 to 1]![AIDX]
Me.FilterOn = True

To the report in the 'on open'

When I goto the form and click on the email button. The pop-up box to
select a file type comes up, once a selection is made, nothing happens,
Outlook does not even open anymore. What did I do wrong? How do I fix it?

--
Thank-you!
Ruth


Tony Toews said:
I think what you meant to say was that the report would contain only
the record that is on the form that the user is displaying.

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
R

Ruth

It is the current report that I want to be sent. I have the button on the
form. If it could send the current form, it would be even better, but from
what I understand, which may be incorrect, only a report can be sent out. So
I built a report, and it sends out the entire report, but I only want it to
send the current record.


--
Thank-you!
Ruth


Stockwell43 said:
For Output Format on your Macro select Rich Text Format. As far as a filter I
don't see one on the macro. Also, that code you have I not necessary for a
pre-existing report unless you are trying to do like Tony mentioned and send
only the information on the current record.

I think we need to find out some information first. Do you have a report
created in Access or are you trying to send ONLY the current record the user
is on? If it's a full report, I gave you explict instruction on how to create
the Macro that you should be 100% successful because access guide you through
the whole thing with no coding. If it's only the current record, I cannot
help you be cause I have never do that before.

Ruth said:
Thank-you for your help, but I don't know what I did wrong as it does not work.

I went to the web site that Tony suggested. I am sorry, but I must be
missing something or mixing things up. I added the code:

Me.Filter = Morning Report![AIDX] & Forms![New Trip Report 1 to 1]![AIDX]
Me.FilterOn = True

To the report in the 'on open'

When I goto the form and click on the email button. The pop-up box to
select a file type comes up, once a selection is made, nothing happens,
Outlook does not even open anymore. What did I do wrong? How do I fix it?

--
Thank-you!
Ruth


Tony Toews said:
After doing everything the hard way and not having any success, I used the
wizard to create a button to email a report via outlook. I know want to add
the codes so that it emails the current report only (the report that
corresponds to the form that the email button is on.

I think what you meant to say was that the report would contain only
the record that is on the form that the user is displaying.

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
S

Stockwell43

If all your looking to send is the current record, then take out the report
command so only a blank email will pop up when you hit the button. So:

1. When the user is on the current record, have them hit the "Print Screen"
button on the keyboard

2. Right click on the screen print and select "Copy"

3. Click on the Email Button on the form.

4. When the BLANK email opens, click in the message body of the email, right
click and selct "Paste" and send the email.

Not exactly the most professional way but maybe someone on this forum can
give you some code to do the same thing. In the meantime, it will do what you
need it to do.
Ruth said:
It is the current report that I want to be sent. I have the button on the
form. If it could send the current form, it would be even better, but from
what I understand, which may be incorrect, only a report can be sent out. So
I built a report, and it sends out the entire report, but I only want it to
send the current record.


--
Thank-you!
Ruth


Stockwell43 said:
For Output Format on your Macro select Rich Text Format. As far as a filter I
don't see one on the macro. Also, that code you have I not necessary for a
pre-existing report unless you are trying to do like Tony mentioned and send
only the information on the current record.

I think we need to find out some information first. Do you have a report
created in Access or are you trying to send ONLY the current record the user
is on? If it's a full report, I gave you explict instruction on how to create
the Macro that you should be 100% successful because access guide you through
the whole thing with no coding. If it's only the current record, I cannot
help you be cause I have never do that before.

Ruth said:
Thank-you for your help, but I don't know what I did wrong as it does not work.

I went to the web site that Tony suggested. I am sorry, but I must be
missing something or mixing things up. I added the code:

Me.Filter = Morning Report![AIDX] & Forms![New Trip Report 1 to 1]![AIDX]
Me.FilterOn = True

To the report in the 'on open'

When I goto the form and click on the email button. The pop-up box to
select a file type comes up, once a selection is made, nothing happens,
Outlook does not even open anymore. What did I do wrong? How do I fix it?

--
Thank-you!
Ruth


:


After doing everything the hard way and not having any success, I used the
wizard to create a button to email a report via outlook. I know want to add
the codes so that it emails the current report only (the report that
corresponds to the form that the email button is on.

I think what you meant to say was that the report would contain only
the record that is on the form that the user is displaying.

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
R

Ruth

Thank-you -- that is a lot closer than what I have now. Can I save those
steps as a Macro so they just need to click a button and it will do it?

--
Thank-you!
Ruth


Stockwell43 said:
If all your looking to send is the current record, then take out the report
command so only a blank email will pop up when you hit the button. So:

1. When the user is on the current record, have them hit the "Print Screen"
button on the keyboard

2. Right click on the screen print and select "Copy"

3. Click on the Email Button on the form.

4. When the BLANK email opens, click in the message body of the email, right
click and selct "Paste" and send the email.

Not exactly the most professional way but maybe someone on this forum can
give you some code to do the same thing. In the meantime, it will do what you
need it to do.
Ruth said:
It is the current report that I want to be sent. I have the button on the
form. If it could send the current form, it would be even better, but from
what I understand, which may be incorrect, only a report can be sent out. So
I built a report, and it sends out the entire report, but I only want it to
send the current record.


--
Thank-you!
Ruth


Stockwell43 said:
For Output Format on your Macro select Rich Text Format. As far as a filter I
don't see one on the macro. Also, that code you have I not necessary for a
pre-existing report unless you are trying to do like Tony mentioned and send
only the information on the current record.

I think we need to find out some information first. Do you have a report
created in Access or are you trying to send ONLY the current record the user
is on? If it's a full report, I gave you explict instruction on how to create
the Macro that you should be 100% successful because access guide you through
the whole thing with no coding. If it's only the current record, I cannot
help you be cause I have never do that before.

:

Thank-you for your help, but I don't know what I did wrong as it does not work.

I went to the web site that Tony suggested. I am sorry, but I must be
missing something or mixing things up. I added the code:

Me.Filter = Morning Report![AIDX] & Forms![New Trip Report 1 to 1]![AIDX]
Me.FilterOn = True

To the report in the 'on open'

When I goto the form and click on the email button. The pop-up box to
select a file type comes up, once a selection is made, nothing happens,
Outlook does not even open anymore. What did I do wrong? How do I fix it?

--
Thank-you!
Ruth


:


After doing everything the hard way and not having any success, I used the
wizard to create a button to email a report via outlook. I know want to add
the codes so that it emails the current report only (the report that
corresponds to the form that the email button is on.

I think what you meant to say was that the report would contain only
the record that is on the form that the user is displaying.

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
R

Ruth

Hi again

I tried to take out the command to send the report and the outlook does not
pop up now. What line(s) needs to be removed.
--
Thank-you!
Ruth


Ruth said:
It is the current report that I want to be sent. I have the button on the
form. If it could send the current form, it would be even better, but from
what I understand, which may be incorrect, only a report can be sent out. So
I built a report, and it sends out the entire report, but I only want it to
send the current record.


--
Thank-you!
Ruth


Stockwell43 said:
For Output Format on your Macro select Rich Text Format. As far as a filter I
don't see one on the macro. Also, that code you have I not necessary for a
pre-existing report unless you are trying to do like Tony mentioned and send
only the information on the current record.

I think we need to find out some information first. Do you have a report
created in Access or are you trying to send ONLY the current record the user
is on? If it's a full report, I gave you explict instruction on how to create
the Macro that you should be 100% successful because access guide you through
the whole thing with no coding. If it's only the current record, I cannot
help you be cause I have never do that before.

Ruth said:
Thank-you for your help, but I don't know what I did wrong as it does not work.

I went to the web site that Tony suggested. I am sorry, but I must be
missing something or mixing things up. I added the code:

Me.Filter = Morning Report![AIDX] & Forms![New Trip Report 1 to 1]![AIDX]
Me.FilterOn = True

To the report in the 'on open'

When I goto the form and click on the email button. The pop-up box to
select a file type comes up, once a selection is made, nothing happens,
Outlook does not even open anymore. What did I do wrong? How do I fix it?

--
Thank-you!
Ruth


:


After doing everything the hard way and not having any success, I used the
wizard to create a button to email a report via outlook. I know want to add
the codes so that it emails the current report only (the report that
corresponds to the form that the email button is on.

I think what you meant to say was that the report would contain only
the record that is on the form that the user is displaying.

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
S

Stockwell43

Hi Ruth,

Glad to see at least your making some head wave. If button is driven by a
macro you created, take out what is in the "Object Name" field in the Macro
and you be fine.

Ruth said:
Hi again

I tried to take out the command to send the report and the outlook does not
pop up now. What line(s) needs to be removed.
--
Thank-you!
Ruth


Ruth said:
It is the current report that I want to be sent. I have the button on the
form. If it could send the current form, it would be even better, but from
what I understand, which may be incorrect, only a report can be sent out. So
I built a report, and it sends out the entire report, but I only want it to
send the current record.


--
Thank-you!
Ruth


Stockwell43 said:
For Output Format on your Macro select Rich Text Format. As far as a filter I
don't see one on the macro. Also, that code you have I not necessary for a
pre-existing report unless you are trying to do like Tony mentioned and send
only the information on the current record.

I think we need to find out some information first. Do you have a report
created in Access or are you trying to send ONLY the current record the user
is on? If it's a full report, I gave you explict instruction on how to create
the Macro that you should be 100% successful because access guide you through
the whole thing with no coding. If it's only the current record, I cannot
help you be cause I have never do that before.

:

Thank-you for your help, but I don't know what I did wrong as it does not work.

I went to the web site that Tony suggested. I am sorry, but I must be
missing something or mixing things up. I added the code:

Me.Filter = Morning Report![AIDX] & Forms![New Trip Report 1 to 1]![AIDX]
Me.FilterOn = True

To the report in the 'on open'

When I goto the form and click on the email button. The pop-up box to
select a file type comes up, once a selection is made, nothing happens,
Outlook does not even open anymore. What did I do wrong? How do I fix it?

--
Thank-you!
Ruth


:


After doing everything the hard way and not having any success, I used the
wizard to create a button to email a report via outlook. I know want to add
the codes so that it emails the current report only (the report that
corresponds to the form that the email button is on.

I think what you meant to say was that the report would contain only
the record that is on the form that the user is displaying.

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
R

Ruth

Hi Stockwell43

I thought that making a macro in Access would be the same as in Excel, just
do the steps and it records it as you go along. when I go to make a macro,
it requires some coding... is there an easy way (hopefully like it is in
excel) to do this that I am missing?

--
Thank-you!
Ruth


Stockwell43 said:
Hi Ruth,

Glad to see at least your making some head wave. If button is driven by a
macro you created, take out what is in the "Object Name" field in the Macro
and you be fine.

Ruth said:
Hi again

I tried to take out the command to send the report and the outlook does not
pop up now. What line(s) needs to be removed.
--
Thank-you!
Ruth


Ruth said:
It is the current report that I want to be sent. I have the button on the
form. If it could send the current form, it would be even better, but from
what I understand, which may be incorrect, only a report can be sent out. So
I built a report, and it sends out the entire report, but I only want it to
send the current record.


--
Thank-you!
Ruth


:

For Output Format on your Macro select Rich Text Format. As far as a filter I
don't see one on the macro. Also, that code you have I not necessary for a
pre-existing report unless you are trying to do like Tony mentioned and send
only the information on the current record.

I think we need to find out some information first. Do you have a report
created in Access or are you trying to send ONLY the current record the user
is on? If it's a full report, I gave you explict instruction on how to create
the Macro that you should be 100% successful because access guide you through
the whole thing with no coding. If it's only the current record, I cannot
help you be cause I have never do that before.

:

Thank-you for your help, but I don't know what I did wrong as it does not work.

I went to the web site that Tony suggested. I am sorry, but I must be
missing something or mixing things up. I added the code:

Me.Filter = Morning Report![AIDX] & Forms![New Trip Report 1 to 1]![AIDX]
Me.FilterOn = True

To the report in the 'on open'

When I goto the form and click on the email button. The pop-up box to
select a file type comes up, once a selection is made, nothing happens,
Outlook does not even open anymore. What did I do wrong? How do I fix it?

--
Thank-you!
Ruth


:


After doing everything the hard way and not having any success, I used the
wizard to create a button to email a report via outlook. I know want to add
the codes so that it emails the current report only (the report that
corresponds to the form that the email button is on.

I think what you meant to say was that the report would contain only
the record that is on the form that the user is displaying.

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
S

Stockwell43

Ok Ruth, we are going to make this as easy as possible listen closely.

1. I want you to delete the button off of your form that you created.

2. Create a brand new button and when the wizard open just click Cancel.

3. Open the properties of the button and scroll down to the On Click event.

4. Click on the arrow to open the drop down box for the On Click Event and
select Event Procedure.

5. Click on the three little dots "..." to the right of the drop down box to
open the code window.

6. Between the Private Sub and End Sub place this piece of code in:

On Error GoTo EH
DoCmd.SendObject
EH:
If Err.Number = 2501 Then
MsgBox "This email message has not been sent. Message has been
cancelled."
End If

I just tested it and it works perfectly. I am not sure about what you did so
that is why I am suggesting to delete the old button and start fresh.

Also, I would to suggest (if you haven't already) to purchase one or two
books on Access. When I started out and even now, I buy them off of Amazon
really cheap and they are in nice shape. They can be from Access 2000 - 2003
because it's basically the same. 2007 is completely different so if that is
what you are using, it could explain why you are having the trouble your
having. The books are also a great reference tool. Also, there are a lot of
great websites like this one that is chock full of code and neat things you
can do in Access and it's all free and very accurate. I am not an expert or
even close with Access but I did learn a lot from these folks and save all
the code in a Word document for future use as well as a copy of all my
databases.

Hope this helps!!

Ruth said:
Hi Stockwell43

I thought that making a macro in Access would be the same as in Excel, just
do the steps and it records it as you go along. when I go to make a macro,
it requires some coding... is there an easy way (hopefully like it is in
excel) to do this that I am missing?

--
Thank-you!
Ruth


Stockwell43 said:
Hi Ruth,

Glad to see at least your making some head wave. If button is driven by a
macro you created, take out what is in the "Object Name" field in the Macro
and you be fine.

Ruth said:
Hi again

I tried to take out the command to send the report and the outlook does not
pop up now. What line(s) needs to be removed.
--
Thank-you!
Ruth


:

It is the current report that I want to be sent. I have the button on the
form. If it could send the current form, it would be even better, but from
what I understand, which may be incorrect, only a report can be sent out. So
I built a report, and it sends out the entire report, but I only want it to
send the current record.


--
Thank-you!
Ruth


:

For Output Format on your Macro select Rich Text Format. As far as a filter I
don't see one on the macro. Also, that code you have I not necessary for a
pre-existing report unless you are trying to do like Tony mentioned and send
only the information on the current record.

I think we need to find out some information first. Do you have a report
created in Access or are you trying to send ONLY the current record the user
is on? If it's a full report, I gave you explict instruction on how to create
the Macro that you should be 100% successful because access guide you through
the whole thing with no coding. If it's only the current record, I cannot
help you be cause I have never do that before.

:

Thank-you for your help, but I don't know what I did wrong as it does not work.

I went to the web site that Tony suggested. I am sorry, but I must be
missing something or mixing things up. I added the code:

Me.Filter = Morning Report![AIDX] & Forms![New Trip Report 1 to 1]![AIDX]
Me.FilterOn = True

To the report in the 'on open'

When I goto the form and click on the email button. The pop-up box to
select a file type comes up, once a selection is made, nothing happens,
Outlook does not even open anymore. What did I do wrong? How do I fix it?

--
Thank-you!
Ruth


:


After doing everything the hard way and not having any success, I used the
wizard to create a button to email a report via outlook. I know want to add
the codes so that it emails the current report only (the report that
corresponds to the form that the email button is on.

I think what you meant to say was that the report would contain only
the record that is on the form that the user is displaying.

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
R

Ruth

Hi Stockwell43

I did it and it know pulls up a blank outlook email message. Thank-you!


I have a Access book-- but it doesn't go very far in the coding etc. Do you
have any that you recommend?
I am working in Access 2003

Also, Is there an easy way to build a macro--like in Excel- or is it all
coding?

--
Thank-you!
Ruth


Stockwell43 said:
Ok Ruth, we are going to make this as easy as possible listen closely.

1. I want you to delete the button off of your form that you created.

2. Create a brand new button and when the wizard open just click Cancel.

3. Open the properties of the button and scroll down to the On Click event.

4. Click on the arrow to open the drop down box for the On Click Event and
select Event Procedure.

5. Click on the three little dots "..." to the right of the drop down box to
open the code window.

6. Between the Private Sub and End Sub place this piece of code in:

On Error GoTo EH
DoCmd.SendObject
EH:
If Err.Number = 2501 Then
MsgBox "This email message has not been sent. Message has been
cancelled."
End If

I just tested it and it works perfectly. I am not sure about what you did so
that is why I am suggesting to delete the old button and start fresh.

Also, I would to suggest (if you haven't already) to purchase one or two
books on Access. When I started out and even now, I buy them off of Amazon
really cheap and they are in nice shape. They can be from Access 2000 - 2003
because it's basically the same. 2007 is completely different so if that is
what you are using, it could explain why you are having the trouble your
having. The books are also a great reference tool. Also, there are a lot of
great websites like this one that is chock full of code and neat things you
can do in Access and it's all free and very accurate. I am not an expert or
even close with Access but I did learn a lot from these folks and save all
the code in a Word document for future use as well as a copy of all my
databases.

Hope this helps!!

Ruth said:
Hi Stockwell43

I thought that making a macro in Access would be the same as in Excel, just
do the steps and it records it as you go along. when I go to make a macro,
it requires some coding... is there an easy way (hopefully like it is in
excel) to do this that I am missing?

--
Thank-you!
Ruth


Stockwell43 said:
Hi Ruth,

Glad to see at least your making some head wave. If button is driven by a
macro you created, take out what is in the "Object Name" field in the Macro
and you be fine.

:

Hi again

I tried to take out the command to send the report and the outlook does not
pop up now. What line(s) needs to be removed.
--
Thank-you!
Ruth


:

It is the current report that I want to be sent. I have the button on the
form. If it could send the current form, it would be even better, but from
what I understand, which may be incorrect, only a report can be sent out. So
I built a report, and it sends out the entire report, but I only want it to
send the current record.


--
Thank-you!
Ruth


:

For Output Format on your Macro select Rich Text Format. As far as a filter I
don't see one on the macro. Also, that code you have I not necessary for a
pre-existing report unless you are trying to do like Tony mentioned and send
only the information on the current record.

I think we need to find out some information first. Do you have a report
created in Access or are you trying to send ONLY the current record the user
is on? If it's a full report, I gave you explict instruction on how to create
the Macro that you should be 100% successful because access guide you through
the whole thing with no coding. If it's only the current record, I cannot
help you be cause I have never do that before.

:

Thank-you for your help, but I don't know what I did wrong as it does not work.

I went to the web site that Tony suggested. I am sorry, but I must be
missing something or mixing things up. I added the code:

Me.Filter = Morning Report![AIDX] & Forms![New Trip Report 1 to 1]![AIDX]
Me.FilterOn = True

To the report in the 'on open'

When I goto the form and click on the email button. The pop-up box to
select a file type comes up, once a selection is made, nothing happens,
Outlook does not even open anymore. What did I do wrong? How do I fix it?

--
Thank-you!
Ruth


:


After doing everything the hard way and not having any success, I used the
wizard to create a button to email a report via outlook. I know want to add
the codes so that it emails the current report only (the report that
corresponds to the form that the email button is on.

I think what you meant to say was that the report would contain only
the record that is on the form that the user is displaying.

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
S

Stockwell43

Your very welcome, glad I could help.

Well, your really not going to find may that deal strictly with code.
However, so are more informational as for as different things you can do and
it helps because I use a lot of what they talk about or at least get some
ideas. I would recommend the following:

Access 2002 Visual Basic, Access 2003 Inside Track, Access 2003 Inside Out,
Access 2003 Bible.

Of course it depends on the reader as well. I would look these up on Amazon
and I'll bet you can pick them up cheap even if they are 2000 or 2002.

Here are a couple of good sites:

http://www.techonthenet.com/access/index.php
http://www.blueclaw-db.com/download/
http://www.blueclaw-db.com/accessvisualbasic/
http://www.accessmvp.com/djsteele/AccessIndex.html
http://office.microsoft.com/en-us/templates/CT101426031033.aspx
http://www.endprod.com/colors/
http://office.microsoft.com/en-us/access/HA011813841033.aspx?pid=CL100570041033
http://office.microsoft.com/en-us/access/HA011814491033.aspx?pid=CL100570041033
http://jksalescompany.com/ken/colorslist.htm
http://office.microsoft.com/en-us/access/HP011359591033.aspx?pid=CH011413201033




Ruth said:
Hi Stockwell43

I did it and it know pulls up a blank outlook email message. Thank-you!


I have a Access book-- but it doesn't go very far in the coding etc. Do you
have any that you recommend?
I am working in Access 2003

Also, Is there an easy way to build a macro--like in Excel- or is it all
coding?

--
Thank-you!
Ruth


Stockwell43 said:
Ok Ruth, we are going to make this as easy as possible listen closely.

1. I want you to delete the button off of your form that you created.

2. Create a brand new button and when the wizard open just click Cancel.

3. Open the properties of the button and scroll down to the On Click event.

4. Click on the arrow to open the drop down box for the On Click Event and
select Event Procedure.

5. Click on the three little dots "..." to the right of the drop down box to
open the code window.

6. Between the Private Sub and End Sub place this piece of code in:

On Error GoTo EH
DoCmd.SendObject
EH:
If Err.Number = 2501 Then
MsgBox "This email message has not been sent. Message has been
cancelled."
End If

I just tested it and it works perfectly. I am not sure about what you did so
that is why I am suggesting to delete the old button and start fresh.

Also, I would to suggest (if you haven't already) to purchase one or two
books on Access. When I started out and even now, I buy them off of Amazon
really cheap and they are in nice shape. They can be from Access 2000 - 2003
because it's basically the same. 2007 is completely different so if that is
what you are using, it could explain why you are having the trouble your
having. The books are also a great reference tool. Also, there are a lot of
great websites like this one that is chock full of code and neat things you
can do in Access and it's all free and very accurate. I am not an expert or
even close with Access but I did learn a lot from these folks and save all
the code in a Word document for future use as well as a copy of all my
databases.

Hope this helps!!

Ruth said:
Hi Stockwell43

I thought that making a macro in Access would be the same as in Excel, just
do the steps and it records it as you go along. when I go to make a macro,
it requires some coding... is there an easy way (hopefully like it is in
excel) to do this that I am missing?

--
Thank-you!
Ruth


:

Hi Ruth,

Glad to see at least your making some head wave. If button is driven by a
macro you created, take out what is in the "Object Name" field in the Macro
and you be fine.

:

Hi again

I tried to take out the command to send the report and the outlook does not
pop up now. What line(s) needs to be removed.
--
Thank-you!
Ruth


:

It is the current report that I want to be sent. I have the button on the
form. If it could send the current form, it would be even better, but from
what I understand, which may be incorrect, only a report can be sent out. So
I built a report, and it sends out the entire report, but I only want it to
send the current record.


--
Thank-you!
Ruth


:

For Output Format on your Macro select Rich Text Format. As far as a filter I
don't see one on the macro. Also, that code you have I not necessary for a
pre-existing report unless you are trying to do like Tony mentioned and send
only the information on the current record.

I think we need to find out some information first. Do you have a report
created in Access or are you trying to send ONLY the current record the user
is on? If it's a full report, I gave you explict instruction on how to create
the Macro that you should be 100% successful because access guide you through
the whole thing with no coding. If it's only the current record, I cannot
help you be cause I have never do that before.

:

Thank-you for your help, but I don't know what I did wrong as it does not work.

I went to the web site that Tony suggested. I am sorry, but I must be
missing something or mixing things up. I added the code:

Me.Filter = Morning Report![AIDX] & Forms![New Trip Report 1 to 1]![AIDX]
Me.FilterOn = True

To the report in the 'on open'

When I goto the form and click on the email button. The pop-up box to
select a file type comes up, once a selection is made, nothing happens,
Outlook does not even open anymore. What did I do wrong? How do I fix it?

--
Thank-you!
Ruth


:


After doing everything the hard way and not having any success, I used the
wizard to create a button to email a report via outlook. I know want to add
the codes so that it emails the current report only (the report that
corresponds to the form that the email button is on.

I think what you meant to say was that the report would contain only
the record that is on the form that the user is displaying.

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
T

Tony Toews [MVP]

Ruth said:
I went to the web site that Tony suggested. I am sorry, but I must be
missing something or mixing things up. I added the code:

Me.Filter = Morning Report![AIDX] & Forms![New Trip Report 1 to 1]![AIDX]
Me.FilterOn = True

To the report in the 'on open'

The value that you are putting in the filter string must resemble the
WHERE clause on a query.

At a minimum it will have a field name (which is present on the report
or query), an operator field and a value. Something like

me.filter = "AIDX=" & Forms![New Trip Report 1 to 1]![AIDX]

which will evaluated as something like

me.filter = "AIDX=12345"

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
R

Ruth

Stockwell43

Thank-you for all your help. Sorry, it took me so long, but they have me
working on other projects, too busy these days.

Thanks again!

--
Thank-you!
Ruth


Stockwell43 said:
Your very welcome, glad I could help.

Well, your really not going to find may that deal strictly with code.
However, so are more informational as for as different things you can do and
it helps because I use a lot of what they talk about or at least get some
ideas. I would recommend the following:

Access 2002 Visual Basic, Access 2003 Inside Track, Access 2003 Inside Out,
Access 2003 Bible.

Of course it depends on the reader as well. I would look these up on Amazon
and I'll bet you can pick them up cheap even if they are 2000 or 2002.

Here are a couple of good sites:

http://www.techonthenet.com/access/index.php
http://www.blueclaw-db.com/download/
http://www.blueclaw-db.com/accessvisualbasic/
http://www.accessmvp.com/djsteele/AccessIndex.html
http://office.microsoft.com/en-us/templates/CT101426031033.aspx
http://www.endprod.com/colors/
http://office.microsoft.com/en-us/access/HA011813841033.aspx?pid=CL100570041033
http://office.microsoft.com/en-us/access/HA011814491033.aspx?pid=CL100570041033
http://jksalescompany.com/ken/colorslist.htm
http://office.microsoft.com/en-us/access/HP011359591033.aspx?pid=CH011413201033




Ruth said:
Hi Stockwell43

I did it and it know pulls up a blank outlook email message. Thank-you!


I have a Access book-- but it doesn't go very far in the coding etc. Do you
have any that you recommend?
I am working in Access 2003

Also, Is there an easy way to build a macro--like in Excel- or is it all
coding?

--
Thank-you!
Ruth


Stockwell43 said:
Ok Ruth, we are going to make this as easy as possible listen closely.

1. I want you to delete the button off of your form that you created.

2. Create a brand new button and when the wizard open just click Cancel.

3. Open the properties of the button and scroll down to the On Click event.

4. Click on the arrow to open the drop down box for the On Click Event and
select Event Procedure.

5. Click on the three little dots "..." to the right of the drop down box to
open the code window.

6. Between the Private Sub and End Sub place this piece of code in:

On Error GoTo EH
DoCmd.SendObject
EH:
If Err.Number = 2501 Then
MsgBox "This email message has not been sent. Message has been
cancelled."
End If

I just tested it and it works perfectly. I am not sure about what you did so
that is why I am suggesting to delete the old button and start fresh.

Also, I would to suggest (if you haven't already) to purchase one or two
books on Access. When I started out and even now, I buy them off of Amazon
really cheap and they are in nice shape. They can be from Access 2000 - 2003
because it's basically the same. 2007 is completely different so if that is
what you are using, it could explain why you are having the trouble your
having. The books are also a great reference tool. Also, there are a lot of
great websites like this one that is chock full of code and neat things you
can do in Access and it's all free and very accurate. I am not an expert or
even close with Access but I did learn a lot from these folks and save all
the code in a Word document for future use as well as a copy of all my
databases.

Hope this helps!!

:

Hi Stockwell43

I thought that making a macro in Access would be the same as in Excel, just
do the steps and it records it as you go along. when I go to make a macro,
it requires some coding... is there an easy way (hopefully like it is in
excel) to do this that I am missing?

--
Thank-you!
Ruth


:

Hi Ruth,

Glad to see at least your making some head wave. If button is driven by a
macro you created, take out what is in the "Object Name" field in the Macro
and you be fine.

:

Hi again

I tried to take out the command to send the report and the outlook does not
pop up now. What line(s) needs to be removed.
--
Thank-you!
Ruth


:

It is the current report that I want to be sent. I have the button on the
form. If it could send the current form, it would be even better, but from
what I understand, which may be incorrect, only a report can be sent out. So
I built a report, and it sends out the entire report, but I only want it to
send the current record.


--
Thank-you!
Ruth


:

For Output Format on your Macro select Rich Text Format. As far as a filter I
don't see one on the macro. Also, that code you have I not necessary for a
pre-existing report unless you are trying to do like Tony mentioned and send
only the information on the current record.

I think we need to find out some information first. Do you have a report
created in Access or are you trying to send ONLY the current record the user
is on? If it's a full report, I gave you explict instruction on how to create
the Macro that you should be 100% successful because access guide you through
the whole thing with no coding. If it's only the current record, I cannot
help you be cause I have never do that before.

:

Thank-you for your help, but I don't know what I did wrong as it does not work.

I went to the web site that Tony suggested. I am sorry, but I must be
missing something or mixing things up. I added the code:

Me.Filter = Morning Report![AIDX] & Forms![New Trip Report 1 to 1]![AIDX]
Me.FilterOn = True

To the report in the 'on open'

When I goto the form and click on the email button. The pop-up box to
select a file type comes up, once a selection is made, nothing happens,
Outlook does not even open anymore. What did I do wrong? How do I fix it?

--
Thank-you!
Ruth


:


After doing everything the hard way and not having any success, I used the
wizard to create a button to email a report via outlook. I know want to add
the codes so that it emails the current report only (the report that
corresponds to the form that the email button is on.

I think what you meant to say was that the report would contain only
the record that is on the form that the user is displaying.

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

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