Create email from code - Help

  • Thread starter Thread starter MikeB
  • Start date Start date
M

MikeB

I would like to create a email from a form button. How it the best way to
do this?

Here is what I would like to see happen. Click a button to open a email
window (I use Outlook 2003). From my database when I am on a specific
record (this would be open in the form). Have the email address, field name
"mbemail" go right into the To: position. Then have the Subject position
filled in with "Response to your request" this would be the same for all
emails. And the area I am having to most difficulty with is the body area.
I want to have the request message repeated in the body. This would be
field "mbrequest1", this way I don't have to cut and paste. I could then
type my response below this, and click send. Saves time.

Here is my code.

Private Sub Command35_Click()
Dim strmbrequest1 As String
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD")
DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , , "Response to
your request", _
strmbrequest1 & vbCrLf , True
End Sub

There maybe a better way of doing this. Any help or suggestions would be
very helpful. Or if I am totally of base and there is a better way please
let me know. I am still very new to Access coding, and work a lot of my
problems out be trying to see what others have done.

Thanks very much,
Mike
 
Mike,

Have you looked at the SendObject method? While primarily used to send
Access objects such as tables, queries, reports, it can certainly be used
without sending an object.
 
Cheryl,

I may be confused, and that's not hard to do for me since I am new at this,
but isn't that the method I am using below. Or am I using the SendObject in
the wrong way from what you are talking about. Thanks for your replay,
please let me kow where I have gone in the wrong direction.

Thanks,
Mike

~~~~~~~~~~~~~~~~



Cheryl Fischer said:
Mike,

Have you looked at the SendObject method? While primarily used to send
Access objects such as tables, queries, reports, it can certainly be used
without sending an object.

--

Cheryl Fischer, MVP Microsoft Access



MikeB said:
I would like to create a email from a form button. How it the best way to
do this?

Here is what I would like to see happen. Click a button to open a email
window (I use Outlook 2003). From my database when I am on a specific
record (this would be open in the form). Have the email address, field name
"mbemail" go right into the To: position. Then have the Subject position
filled in with "Response to your request" this would be the same for all
emails. And the area I am having to most difficulty with is the body area.
I want to have the request message repeated in the body. This would be
field "mbrequest1", this way I don't have to cut and paste. I could then
type my response below this, and click send. Saves time.

Here is my code.

Private Sub Command35_Click()
Dim strmbrequest1 As String
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD")
DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , , "Response to
your request", _
strmbrequest1 & vbCrLf , True
End Sub

There maybe a better way of doing this. Any help or suggestions would be
very helpful. Or if I am totally of base and there is a better way please
let me know. I am still very new to Access coding, and work a lot of my
problems out be trying to see what others have done.

Thanks very much,
Mike
 
Try the following ...

Private Sub Command35_Click()

Dim strEmail as String
Dim strCompname As String

strEmail = Me!mbemail
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") & vbCrLf &
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , , "Response to
your request", _
strCompname, True

End Sub


--

Cheryl Fischer, MVP Microsoft Access



MikeB said:
Cheryl,

I may be confused, and that's not hard to do for me since I am new at this,
but isn't that the method I am using below. Or am I using the SendObject in
the wrong way from what you are talking about. Thanks for your replay,
please let me kow where I have gone in the wrong direction.

Thanks,
Mike

~~~~~~~~~~~~~~~~



Cheryl Fischer said:
Mike,

Have you looked at the SendObject method? While primarily used to send
Access objects such as tables, queries, reports, it can certainly be used
without sending an object.
way
to
do this?

Here is what I would like to see happen. Click a button to open a email
window (I use Outlook 2003). From my database when I am on a specific
record (this would be open in the form). Have the email address,
field
name
"mbemail" go right into the To: position. Then have the Subject position
filled in with "Response to your request" this would be the same for all
emails. And the area I am having to most difficulty with is the body area.
I want to have the request message repeated in the body. This would be
field "mbrequest1", this way I don't have to cut and paste. I could then
type my response below this, and click send. Saves time.

Here is my code.

Private Sub Command35_Click()
Dim strmbrequest1 As String
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD")
DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , ,
"Response
 
Cherly,

Thanks. The only thing not working is placing the field information in the
email body. The To: and Subject: fill in just great. any ideas on what I
should change to get the field data to show in the email body area?

Thanks for your help,
Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`


Cheryl Fischer said:
Try the following ...

Private Sub Command35_Click()

Dim strEmail as String
Dim strCompname As String

strEmail = Me!mbemail
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") & vbCrLf &
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , , "Response to
your request", _
strCompname, True

End Sub


--

Cheryl Fischer, MVP Microsoft Access



MikeB said:
Cheryl,

I may be confused, and that's not hard to do for me since I am new at this,
but isn't that the method I am using below. Or am I using the
SendObject
in
the wrong way from what you are talking about. Thanks for your replay,
please let me kow where I have gone in the wrong direction.

Thanks,
Mike

~~~~~~~~~~~~~~~~



Cheryl Fischer said:
Mike,

Have you looked at the SendObject method? While primarily used
to
send
Access objects such as tables, queries, reports, it can certainly be used
without sending an object.

--

Cheryl Fischer, MVP Microsoft Access



I would like to create a email from a form button. How it the best
way
to
do this?

Here is what I would like to see happen. Click a button to open a email
window (I use Outlook 2003). From my database when I am on a specific
record (this would be open in the form). Have the email address, field
name
"mbemail" go right into the To: position. Then have the Subject position
filled in with "Response to your request" this would be the same
for
all
emails. And the area I am having to most difficulty with is the body
area.
I want to have the request message repeated in the body. This would be
field "mbrequest1", this way I don't have to cut and paste. I could then
type my response below this, and click send. Saves time.

Here is my code.

Private Sub Command35_Click()
Dim strmbrequest1 As String
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD")
DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , ,
"Response
to
your request", _
strmbrequest1 & vbCrLf , True
End Sub

There maybe a better way of doing this. Any help or suggestions
would
be
very helpful. Or if I am totally of base and there is a better way please
let me know. I am still very new to Access coding, and work a lot
of
 
Is the problem occurring with this line?

strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") & vbCrLf &
vbCrLf

If "mbrequest1" is the name of a control on your form, try this modification
....

strCompname = "Request: " & Nz(Me!mbrequest1, "BLANK FIELD") & vbCrLf &
vbCrLf


Let me know ...
--

Cheryl Fischer, MVP Microsoft Access



MikeB said:
Cherly,

Thanks. The only thing not working is placing the field information in the
email body. The To: and Subject: fill in just great. any ideas on what I
should change to get the field data to show in the email body area?

Thanks for your help,
Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`


Cheryl Fischer said:
Try the following ...

Private Sub Command35_Click()

Dim strEmail as String
Dim strCompname As String

strEmail = Me!mbemail
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") & vbCrLf &
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , , "Response to
your request", _
strCompname, True

End Sub


--

Cheryl Fischer, MVP Microsoft Access



MikeB said:
Cheryl,

I may be confused, and that's not hard to do for me since I am new at this,
but isn't that the method I am using below. Or am I using the
SendObject
in
the wrong way from what you are talking about. Thanks for your replay,
please let me kow where I have gone in the wrong direction.

Thanks,
Mike

~~~~~~~~~~~~~~~~



Mike,

Have you looked at the SendObject method? While primarily used to
send
Access objects such as tables, queries, reports, it can certainly be used
without sending an object.

--

Cheryl Fischer, MVP Microsoft Access



I would like to create a email from a form button. How it the
best
way
to
do this?

Here is what I would like to see happen. Click a button to open a email
window (I use Outlook 2003). From my database when I am on a specific
record (this would be open in the form). Have the email address, field
name
"mbemail" go right into the To: position. Then have the Subject
position
filled in with "Response to your request" this would be the same for
all
emails. And the area I am having to most difficulty with is the body
area.
I want to have the request message repeated in the body. This
would
be
field "mbrequest1", this way I don't have to cut and paste. I could
then
type my response below this, and click send. Saves time.

Here is my code.

Private Sub Command35_Click()
Dim strmbrequest1 As String
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD")
DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , , "Response
to
your request", _
strmbrequest1 & vbCrLf , True
End Sub

There maybe a better way of doing this. Any help or suggestions would
be
very helpful. Or if I am totally of base and there is a better way
please
let me know. I am still very new to Access coding, and work a lot
of
my
problems out be trying to see what others have done.

Thanks very much,
Mike
 
Cherly,

I think the problem seems to be in that line. Here is what my code looks
like now.

Private Sub Command35_Click()

Dim strEmail As String
Dim strCompname As String

strEmail = Me!email

strCompname = "Company Name: " & Nz(Me!compname, "BLANK FIELD") & vbCrLf &
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , , "Your
Link-Belt Preferred Application", _ strCompname, , True

End Sub

I gave you a bad field name that I have changed. The field I want to show
up in the body is compname, which stands for Company Name. See the change
above. Also, what is wierd is if I change the, ", , ," after strEmail, then
the Company Name will show in the Subject Line, and the Subject will show in
the BCC. Now I understand how you determine what information goes in what
position in the email. Therefore I think the second to last line is correct
now, but the line,

strCompname = "Company Name: " & Nz(Me!compname, "BLANK FIELD") & vbCrLf &
vbCrLf

is what is giving me the problem for not showing. I tried this line both
ways you suggested and neither show up in the email body.

Thanks again,

Mike



~~~~~~~~~~~~~~~~~~~~`

Cheryl Fischer said:
Is the problem occurring with this line?

strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") & vbCrLf &
vbCrLf

If "mbrequest1" is the name of a control on your form, try this modification
...

strCompname = "Request: " & Nz(Me!mbrequest1, "BLANK FIELD") & vbCrLf &
vbCrLf


Let me know ...
--

Cheryl Fischer, MVP Microsoft Access



MikeB said:
Cherly,

Thanks. The only thing not working is placing the field information in the
email body. The To: and Subject: fill in just great. any ideas on what I
should change to get the field data to show in the email body area?

Thanks for your help,
Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`


Cheryl Fischer said:
Try the following ...

Private Sub Command35_Click()

Dim strEmail as String
Dim strCompname As String

strEmail = Me!mbemail
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") & vbCrLf &
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , ,
"Response
to
your request", _
strCompname, True

End Sub


--

Cheryl Fischer, MVP Microsoft Access



Cheryl,

I may be confused, and that's not hard to do for me since I am new at
this,
but isn't that the method I am using below. Or am I using the SendObject
in
the wrong way from what you are talking about. Thanks for your replay,
please let me kow where I have gone in the wrong direction.

Thanks,
Mike

~~~~~~~~~~~~~~~~



Mike,

Have you looked at the SendObject method? While primarily
used
to
send
Access objects such as tables, queries, reports, it can certainly be
used
without sending an object.

--

Cheryl Fischer, MVP Microsoft Access



I would like to create a email from a form button. How it the best
way
to
do this?

Here is what I would like to see happen. Click a button to open a
email
window (I use Outlook 2003). From my database when I am on a specific
record (this would be open in the form). Have the email address,
field
name
"mbemail" go right into the To: position. Then have the Subject
position
filled in with "Response to your request" this would be the
same
for
all
emails. And the area I am having to most difficulty with is the body
area.
I want to have the request message repeated in the body. This would
be
field "mbrequest1", this way I don't have to cut and paste. I could
then
type my response below this, and click send. Saves time.

Here is my code.

Private Sub Command35_Click()
Dim strmbrequest1 As String
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD")
DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , ,
"Response
to
your request", _
strmbrequest1 & vbCrLf , True
End Sub

There maybe a better way of doing this. Any help or suggestions would
be
very helpful. Or if I am totally of base and there is a better way
please
let me know. I am still very new to Access coding, and work a
lot
of
my
problems out be trying to see what others have done.

Thanks very much,
Mike
 
A couple of things to try:

1. After you populate your variable, strCompName, stick a MsgBox in there
to test its value, for example:

strCompname = "Company Name: " & Nz(Me!compname, "BLANK FIELD") & vbCrLf &
vbCrLf
MsgBox strCompname

2. If you are not sending an object, there is no need to state an OutPut
Format (acFormatTXT); it probably won't matter, but it doesn't belong.
Also, there are too many commas after inserting strCompName in the
SendObject arguments:

Change: > DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , ,
"Your
Link-Belt Preferred Application", _ strCompname, , True
to:

DoCmd.SendObject acSendNoObject, , , strEmail, , , "Your
Link-Belt Preferred Application", _ strCompname, True

--

Cheryl Fischer, MVP Microsoft Access



MikeB said:
Cherly,

I think the problem seems to be in that line. Here is what my code looks
like now.

Private Sub Command35_Click()

Dim strEmail As String
Dim strCompname As String

strEmail = Me!email

strCompname = "Company Name: " & Nz(Me!compname, "BLANK FIELD") & vbCrLf &
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , , "Your
Link-Belt Preferred Application", _ strCompname, , True

End Sub

I gave you a bad field name that I have changed. The field I want to show
up in the body is compname, which stands for Company Name. See the change
above. Also, what is wierd is if I change the, ", , ," after strEmail, then
the Company Name will show in the Subject Line, and the Subject will show in
the BCC. Now I understand how you determine what information goes in what
position in the email. Therefore I think the second to last line is correct
now, but the line,

strCompname = "Company Name: " & Nz(Me!compname, "BLANK FIELD") & vbCrLf &
vbCrLf

is what is giving me the problem for not showing. I tried this line both
ways you suggested and neither show up in the email body.

Thanks again,

Mike



~~~~~~~~~~~~~~~~~~~~`

Cheryl Fischer said:
Is the problem occurring with this line?

strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") &
vbCrLf
&
vbCrLf

If "mbrequest1" is the name of a control on your form, try this modification
...

strCompname = "Request: " & Nz(Me!mbrequest1, "BLANK FIELD") &
vbCrLf
&
vbCrLf


Let me know ...
--

Cheryl Fischer, MVP Microsoft Access



in
the
what
I
should change to get the field data to show in the email body area?

Thanks for your help,
Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`


Try the following ...

Private Sub Command35_Click()

Dim strEmail as String
Dim strCompname As String

strEmail = Me!mbemail
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") &
vbCrLf
& "Response
certainly
open
a
email
window (I use Outlook 2003). From my database when I am on a
specific
record (this would be open in the form). Have the email address,
field
name
"mbemail" go right into the To: position. Then have the Subject
position
filled in with "Response to your request" this would be the same
for
all
emails. And the area I am having to most difficulty with is the
body
area.
I want to have the request message repeated in the body. This would
be
field "mbrequest1", this way I don't have to cut and paste. I could
then
type my response below this, and click send. Saves time.

Here is my code.

Private Sub Command35_Click()
Dim strmbrequest1 As String
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD")
DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , ,
"Response
to
your request", _
strmbrequest1 & vbCrLf , True
End Sub

There maybe a better way of doing this. Any help or suggestions
would
be
very helpful. Or if I am totally of base and there is a
better
way
please
let me know. I am still very new to Access coding, and work a lot
of
my
problems out be trying to see what others have done.

Thanks very much,
Mike
 
Cheryl,

Thanks for your response.

I made the changes and I still get the same result, no Company Name in the
email body. I added the MsgBox and it does pop-up with the correct Company
Name for the record I am in. So that works fine.

This database is running in Access 2003 now, originally this database was
designed and built in Access 2000, would that make a difference? I
up-graded from Office 2000 to Office 2003.

Also, the acFormatTXT is for report output, correct? I thought is was for
the email format since it was part of the email Send.Object.

Thanks for all your help. This one the surface seems so easy, but as I am
finding out isn't.

Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Cheryl Fischer said:
A couple of things to try:

1. After you populate your variable, strCompName, stick a MsgBox in there
to test its value, for example:

strCompname = "Company Name: " & Nz(Me!compname, "BLANK FIELD") & vbCrLf &
vbCrLf
MsgBox strCompname

2. If you are not sending an object, there is no need to state an OutPut
Format (acFormatTXT); it probably won't matter, but it doesn't belong.
Also, there are too many commas after inserting strCompName in the
SendObject arguments:

Change: > DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , ,
"Your
Link-Belt Preferred Application", _ strCompname, , True
to:

DoCmd.SendObject acSendNoObject, , , strEmail, , , "Your
Link-Belt Preferred Application", _ strCompname, True

--

Cheryl Fischer, MVP Microsoft Access



MikeB said:
Cherly,

I think the problem seems to be in that line. Here is what my code looks
like now.

Private Sub Command35_Click()

Dim strEmail As String
Dim strCompname As String

strEmail = Me!email

strCompname = "Company Name: " & Nz(Me!compname, "BLANK FIELD") & vbCrLf &
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , , "Your
Link-Belt Preferred Application", _ strCompname, , True

End Sub

I gave you a bad field name that I have changed. The field I want to show
up in the body is compname, which stands for Company Name. See the change
above. Also, what is wierd is if I change the, ", , ," after strEmail, then
the Company Name will show in the Subject Line, and the Subject will
show
in
the BCC. Now I understand how you determine what information goes in what
position in the email. Therefore I think the second to last line is correct
now, but the line,

strCompname = "Company Name: " & Nz(Me!compname, "BLANK FIELD") & vbCrLf &
vbCrLf

is what is giving me the problem for not showing. I tried this line both
ways you suggested and neither show up in the email body.

Thanks again,

Mike



~~~~~~~~~~~~~~~~~~~~`

Cheryl Fischer said:
Is the problem occurring with this line?

strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") &
vbCrLf
&
vbCrLf

If "mbrequest1" is the name of a control on your form, try this modification
...

strCompname = "Request: " & Nz(Me!mbrequest1, "BLANK FIELD") &
vbCrLf
&
vbCrLf


Let me know ...
--

Cheryl Fischer, MVP Microsoft Access



Cherly,

Thanks. The only thing not working is placing the field information in
the
email body. The To: and Subject: fill in just great. any ideas on
what
I
should change to get the field data to show in the email body area?

Thanks for your help,
Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`


Try the following ...

Private Sub Command35_Click()

Dim strEmail as String
Dim strCompname As String

strEmail = Me!mbemail
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") &
vbCrLf
&
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , , "Response
to
your request", _
strCompname, True

End Sub


--

Cheryl Fischer, MVP Microsoft Access



Cheryl,

I may be confused, and that's not hard to do for me since I am
new
at
this,
but isn't that the method I am using below. Or am I using the
SendObject
in
the wrong way from what you are talking about. Thanks for your
replay,
please let me kow where I have gone in the wrong direction.

Thanks,
Mike

~~~~~~~~~~~~~~~~



Mike,

Have you looked at the SendObject method? While
primarily
used
to
send
Access objects such as tables, queries, reports, it can
certainly
be
used
without sending an object.

--

Cheryl Fischer, MVP Microsoft Access



I would like to create a email from a form button. How it the
best
way
to
do this?

Here is what I would like to see happen. Click a button to
open
a
email
window (I use Outlook 2003). From my database when I am on a
specific
record (this would be open in the form). Have the email address,
field
name
"mbemail" go right into the To: position. Then have the Subject
position
filled in with "Response to your request" this would be the same
for
all
emails. And the area I am having to most difficulty with is the
body
area.
I want to have the request message repeated in the body. This
would
be
field "mbrequest1", this way I don't have to cut and paste. I
could
then
type my response below this, and click send. Saves time.

Here is my code.

Private Sub Command35_Click()
Dim strmbrequest1 As String
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD")
DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , ,
"Response
to
your request", _
strmbrequest1 & vbCrLf , True
End Sub

There maybe a better way of doing this. Any help or suggestions
would
be
very helpful. Or if I am totally of base and there is a better
way
please
let me know. I am still very new to Access coding, and work
a
lot
of
my
problems out be trying to see what others have done.

Thanks very much,
Mike
 
I do not have Access 2003 installed yet; I am using Access 2002. I will
see if I can find someone to test this out in A2003.

--

Cheryl Fischer, MVP Microsoft Access



MikeB said:
Cheryl,

Thanks for your response.

I made the changes and I still get the same result, no Company Name in the
email body. I added the MsgBox and it does pop-up with the correct Company
Name for the record I am in. So that works fine.

This database is running in Access 2003 now, originally this database was
designed and built in Access 2000, would that make a difference? I
up-graded from Office 2000 to Office 2003.

Also, the acFormatTXT is for report output, correct? I thought is was for
the email format since it was part of the email Send.Object.

Thanks for all your help. This one the surface seems so easy, but as I am
finding out isn't.

Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Cheryl Fischer said:
A couple of things to try:

1. After you populate your variable, strCompName, stick a MsgBox in there
to test its value, for example:

strCompname = "Company Name: " & Nz(Me!compname, "BLANK FIELD") & vbCrLf &
vbCrLf
MsgBox strCompname

2. If you are not sending an object, there is no need to state an OutPut
Format (acFormatTXT); it probably won't matter, but it doesn't belong.
Also, there are too many commas after inserting strCompName in the
SendObject arguments:

Change: > DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , ,
"Your
vbCrLf
& strEmail,
then show
vbCrLf
&
vbCrLf

is what is giving me the problem for not showing. I tried this line both
ways you suggested and neither show up in the email body.

Thanks again,

Mike



~~~~~~~~~~~~~~~~~~~~`

Is the problem occurring with this line?

strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") & vbCrLf
&
vbCrLf

If "mbrequest1" is the name of a control on your form, try this
modification
...

strCompname = "Request: " & Nz(Me!mbrequest1, "BLANK FIELD") & vbCrLf
&
vbCrLf


Let me know ...
--

Cheryl Fischer, MVP Microsoft Access



Cherly,

Thanks. The only thing not working is placing the field
information
in
the
email body. The To: and Subject: fill in just great. any ideas
on
what
I
should change to get the field data to show in the email body area?

Thanks for your help,
Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`


Try the following ...

Private Sub Command35_Click()

Dim strEmail as String
Dim strCompname As String

strEmail = Me!mbemail
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") & vbCrLf
&
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , ,
"Response
to
your request", _
strCompname, True

End Sub


--

Cheryl Fischer, MVP Microsoft Access



Cheryl,

I may be confused, and that's not hard to do for me since I am new
at
this,
but isn't that the method I am using below. Or am I using the
SendObject
in
the wrong way from what you are talking about. Thanks for your
replay,
please let me kow where I have gone in the wrong direction.

Thanks,
Mike

~~~~~~~~~~~~~~~~



Mike,

Have you looked at the SendObject method? While primarily
used
to
send
Access objects such as tables, queries, reports, it can certainly
be
used
without sending an object.

--

Cheryl Fischer, MVP Microsoft Access



I would like to create a email from a form button. How it the
best
way
to
do this?

Here is what I would like to see happen. Click a button
to
open
a
email
window (I use Outlook 2003). From my database when I am
on
paste.
I
could
then
type my response below this, and click send. Saves time.

Here is my code.

Private Sub Command35_Click()
Dim strmbrequest1 As String
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD")
DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail,
,
work
 
Cheryl,

I went to another PC in the office that was running Outlook 2000 and Access
2000 and the code worked great. So now I am not sure whether it is Outlook
or Access that has changed? Any ideas?

Thanks again,
Mike


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




Cheryl Fischer said:
I do not have Access 2003 installed yet; I am using Access 2002. I will
see if I can find someone to test this out in A2003.

--

Cheryl Fischer, MVP Microsoft Access



MikeB said:
Cheryl,

Thanks for your response.

I made the changes and I still get the same result, no Company Name in the
email body. I added the MsgBox and it does pop-up with the correct Company
Name for the record I am in. So that works fine.

This database is running in Access 2003 now, originally this database was
designed and built in Access 2000, would that make a difference? I
up-graded from Office 2000 to Office 2003.

Also, the acFormatTXT is for report output, correct? I thought is was for
the email format since it was part of the email Send.Object.

Thanks for all your help. This one the surface seems so easy, but as I am
finding out isn't.

Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vbCrLf
&
vbCrLf
MsgBox strCompname

2. If you are not sending an object, there is no need to state an OutPut
Format (acFormatTXT); it probably won't matter, but it doesn't belong.
Also, there are too many commas after inserting strCompName in the
SendObject arguments:

Change: > DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , ,
"Your
Link-Belt Preferred Application", _ strCompname, , True

to:

DoCmd.SendObject acSendNoObject, , , strEmail, , , "Your
Link-Belt Preferred Application", _ strCompname, True

--

Cheryl Fischer, MVP Microsoft Access



Cherly,

I think the problem seems to be in that line. Here is what my code looks
like now.

Private Sub Command35_Click()

Dim strEmail As String
Dim strCompname As String

strEmail = Me!email

strCompname = "Company Name: " & Nz(Me!compname, "BLANK FIELD") &
vbCrLf
&
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , , "Your
Link-Belt Preferred Application", _ strCompname, , True

End Sub

I gave you a bad field name that I have changed. The field I want
to
show
up in the body is compname, which stands for Company Name. See the change
above. Also, what is wierd is if I change the, ", , ," after strEmail,
then
the Company Name will show in the Subject Line, and the Subject will show
in
the BCC. Now I understand how you determine what information goes
in
what
position in the email. Therefore I think the second to last line is
correct
now, but the line,

strCompname = "Company Name: " & Nz(Me!compname, "BLANK FIELD") &
vbCrLf
&
vbCrLf

is what is giving me the problem for not showing. I tried this line
both
ways you suggested and neither show up in the email body.

Thanks again,

Mike



~~~~~~~~~~~~~~~~~~~~`

Is the problem occurring with this line?

strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") &
vbCrLf
&
vbCrLf

If "mbrequest1" is the name of a control on your form, try this
modification
...

strCompname = "Request: " & Nz(Me!mbrequest1, "BLANK FIELD") &
vbCrLf
&
vbCrLf


Let me know ...
--

Cheryl Fischer, MVP Microsoft Access



Cherly,

Thanks. The only thing not working is placing the field information
in
the
email body. The To: and Subject: fill in just great. any ideas on
what
I
should change to get the field data to show in the email body area?

Thanks for your help,
Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`


Try the following ...

Private Sub Command35_Click()

Dim strEmail as String
Dim strCompname As String

strEmail = Me!mbemail
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") &
vbCrLf
&
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , ,
"Response
to
your request", _
strCompname, True

End Sub


--

Cheryl Fischer, MVP Microsoft Access



Cheryl,

I may be confused, and that's not hard to do for me since I
am
new
at
this,
but isn't that the method I am using below. Or am I using the
SendObject
in
the wrong way from what you are talking about. Thanks for your
replay,
please let me kow where I have gone in the wrong direction.

Thanks,
Mike

~~~~~~~~~~~~~~~~



Mike,

Have you looked at the SendObject method? While primarily
used
to
send
Access objects such as tables, queries, reports, it can
certainly
be
used
without sending an object.

--

Cheryl Fischer, MVP Microsoft Access



I would like to create a email from a form button. How
it
the
best
way
to
do this?

Here is what I would like to see happen. Click a button to
open
a
email
window (I use Outlook 2003). From my database when I am
on
a
specific
record (this would be open in the form). Have the email
address,
field
name
"mbemail" go right into the To: position. Then have the
Subject
position
filled in with "Response to your request" this would be the
same
for
all
emails. And the area I am having to most difficulty
with
is
the
body
area.
I want to have the request message repeated in the body. This
would
be
field "mbrequest1", this way I don't have to cut and
paste.
I
could
then
type my response below this, and click send. Saves time.

Here is my code.

Private Sub Command35_Click()
Dim strmbrequest1 As String
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD")
DoCmd.SendObject acSendNoObject, , acFormatTXT,
strEmail,
 
I have seen two or three prior posts (other than yours) which note the same
problem: the message text argument of SendObject not getting into the
actual email message body. There were, unfortunately, no responses.

I've asked in the MVP private ng if someone with Access/Office 2003
installed would test this out for us. We should have a response soon.

--

Cheryl Fischer, MVP Microsoft Access



MikeB said:
Cheryl,

I went to another PC in the office that was running Outlook 2000 and Access
2000 and the code worked great. So now I am not sure whether it is Outlook
or Access that has changed? Any ideas?

Thanks again,
Mike


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




Cheryl Fischer said:
I do not have Access 2003 installed yet; I am using Access 2002. I will
see if I can find someone to test this out in A2003.
I
am vbCrLf
,
,
"Your
Link-Belt Preferred Application", _ strCompname, , True

to:

DoCmd.SendObject acSendNoObject, , , strEmail, , , "Your
Link-Belt Preferred Application", _ strCompname, True

--

Cheryl Fischer, MVP Microsoft Access



Cherly,

I think the problem seems to be in that line. Here is what my code
looks
like now.

Private Sub Command35_Click()

Dim strEmail As String
Dim strCompname As String

strEmail = Me!email

strCompname = "Company Name: " & Nz(Me!compname, "BLANK FIELD") & vbCrLf
&
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , , "Your
Link-Belt Preferred Application", _ strCompname, , True

End Sub

I gave you a bad field name that I have changed. The field I want to
show
up in the body is compname, which stands for Company Name. See the
change
above. Also, what is wierd is if I change the, ", , ," after strEmail,
then
the Company Name will show in the Subject Line, and the Subject will
show
in
the BCC. Now I understand how you determine what information goes in
what
position in the email. Therefore I think the second to last line is
correct
now, but the line,

strCompname = "Company Name: " & Nz(Me!compname, "BLANK FIELD") & vbCrLf
&
vbCrLf

is what is giving me the problem for not showing. I tried this line
both
ways you suggested and neither show up in the email body.

Thanks again,

Mike



~~~~~~~~~~~~~~~~~~~~`

Is the problem occurring with this line?

strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") &
vbCrLf
&
vbCrLf

If "mbrequest1" is the name of a control on your form, try this
modification
...

strCompname = "Request: " & Nz(Me!mbrequest1, "BLANK
FIELD")
&
vbCrLf
&
vbCrLf


Let me know ...
--

Cheryl Fischer, MVP Microsoft Access



Cherly,

Thanks. The only thing not working is placing the field information
in
the
email body. The To: and Subject: fill in just great. any
ideas
on
what
I
should change to get the field data to show in the email body area?

Thanks for your help,
Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`


Try the following ...

Private Sub Command35_Click()

Dim strEmail as String
Dim strCompname As String

strEmail = Me!mbemail
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD") &
vbCrLf
&
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , ,
"Response
to
your request", _
strCompname, True

End Sub


--

Cheryl Fischer, MVP Microsoft Access



Cheryl,

I may be confused, and that's not hard to do for me since
I
How
it
the
best
way
to
do this?

Here is what I would like to see happen. Click a
button
to
open
a
email
window (I use Outlook 2003). From my database when I
am
on
a
specific
record (this would be open in the form). Have the email
address,
field
name
"mbemail" go right into the To: position. Then have the
Subject
position
filled in with "Response to your request" this would
be
the
same
for
all
emails. And the area I am having to most difficulty
with
is
the
body
area.
I want to have the request message repeated in the body.
This
would
be
field "mbrequest1", this way I don't have to cut and paste.
I
could
then
type my response below this, and click send. Saves time.

Here is my code.

Private Sub Command35_Click()
Dim strmbrequest1 As String
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD")
DoCmd.SendObject acSendNoObject, , acFormatTXT,
strEmail,
,
,
"Response
to
your request", _
strmbrequest1 & vbCrLf , True
End Sub

There maybe a better way of doing this. Any help or
suggestions
would
be
very helpful. Or if I am totally of base and there is a
better
way
please
let me know. I am still very new to Access coding,
and
work
a
lot
of
my
problems out be trying to see what others have done.

Thanks very much,
Mike
 
Thanks very much.
Mike

~~~~~~~~~~~~~~~~~~~~~


Cheryl Fischer said:
I have seen two or three prior posts (other than yours) which note the same
problem: the message text argument of SendObject not getting into the
actual email message body. There were, unfortunately, no responses.

I've asked in the MVP private ng if someone with Access/Office 2003
installed would test this out for us. We should have a response soon.

--

Cheryl Fischer, MVP Microsoft Access



MikeB said:
Cheryl,

I went to another PC in the office that was running Outlook 2000 and Access
2000 and the code worked great. So now I am not sure whether it is Outlook
or Access that has changed? Any ideas?

Thanks again,
Mike


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




in
the database
was was
for
as
strEmail,
, want
to goes
in
line
is
correct
now, but the line,

strCompname = "Company Name: " & Nz(Me!compname, "BLANK FIELD") &
vbCrLf
&
vbCrLf

is what is giving me the problem for not showing. I tried
this
line
both
ways you suggested and neither show up in the email body.

Thanks again,

Mike



~~~~~~~~~~~~~~~~~~~~`

Is the problem occurring with this line?

strCompname = "Request: " & Nz([mbrequest1], "BLANK
FIELD")
&
vbCrLf
&
vbCrLf

If "mbrequest1" is the name of a control on your form, try this
modification
...

strCompname = "Request: " & Nz(Me!mbrequest1, "BLANK
FIELD")
&
vbCrLf
&
vbCrLf


Let me know ...
--

Cheryl Fischer, MVP Microsoft Access



Cherly,

Thanks. The only thing not working is placing the field
information
in
the
email body. The To: and Subject: fill in just great. any ideas
on
what
I
should change to get the field data to show in the email body
area?

Thanks for your help,
Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`


Try the following ...

Private Sub Command35_Click()

Dim strEmail as String
Dim strCompname As String

strEmail = Me!mbemail
strCompname = "Request: " & Nz([mbrequest1], "BLANK
FIELD")
,
since
I using
the How
I
would
be
the
same
for
all
emails. And the area I am having to most difficulty with
is
the
body
area.
I want to have the request message repeated in the body.
This
would
be
field "mbrequest1", this way I don't have to cut and
paste.
I
could
then
type my response below this, and click send. Saves time.

Here is my code.

Private Sub Command35_Click()
Dim strmbrequest1 As String
strCompname = "Request: " & Nz([mbrequest1], "BLANK
FIELD")
DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail,
,
,
"Response
to
your request", _
strmbrequest1 & vbCrLf , True
End Sub

There maybe a better way of doing this. Any help or
suggestions
would
be
very helpful. Or if I am totally of base and there
is
 
I just tried your code example...and it worked fine.

Here is what I used behind a buttion:

Try the folwling code......

Dim strEmail As String
Dim strCompname As String

strEmail = "(e-mail address removed)"
strCompname = "Request: " & Nz(Null, "BLANK FIELD") & vbCrLf & vbCrLf

DoCmd.SendObject acSendNoObject, , , strEmail, , , "Response to your
request ", strCompname, True
:

The above works for me on office 2003 and outlook 2003....
 
Mike,

I got Office 2003 fully installed late last night. Created a database and
a form and ran the code in question. As Albert reports, the code ran
without flaw and placed the string in the body of the email.

For whatever it's worth, here are some of the parameters:

Office 2003: Did a custom install, selecting Run All From My Computer for
each of the component products.

Outlook 2003: After setting up email account, no other settings were
changed.

Mail Format Settings: "Compose in this message format:" HTML
Use Word 2003 as email editor: True

Operating System: Windows XP Pro, SP1 with all security patches applied.
See here to scan your system's status:
http://v4.windowsupdate.microsoft.com/en/default.asp

Other: Access Version 2.0, Office 97 Pro and Office 2000 Pro also
installed on that system.


Sorry, I cannot provide more info or positive results.
--

Cheryl Fischer, MVP Microsoft Access



MikeB said:
Thanks very much.
Mike

~~~~~~~~~~~~~~~~~~~~~


Cheryl Fischer said:
I have seen two or three prior posts (other than yours) which note the same
problem: the message text argument of SendObject not getting into the
actual email message body. There were, unfortunately, no responses.

I've asked in the MVP private ng if someone with Access/Office 2003
installed would test this out for us. We should have a response soon.
Name
in as MsgBox
in strEmail,
FIELD")
& See
the Subject
will line
FIELD")
&
vbCrLf
&
vbCrLf

is what is giving me the problem for not showing. I tried this
line
both
ways you suggested and neither show up in the email body.

Thanks again,

Mike



~~~~~~~~~~~~~~~~~~~~`

Is the problem occurring with this line?

strCompname = "Request: " & Nz([mbrequest1], "BLANK
FIELD")
&
vbCrLf
&
vbCrLf

If "mbrequest1" is the name of a control on your form, try this
modification
...

strCompname = "Request: " & Nz(Me!mbrequest1, "BLANK FIELD")
&
vbCrLf
&
vbCrLf


Let me know ...
--

Cheryl Fischer, MVP Microsoft Access



Cherly,

Thanks. The only thing not working is placing the field
information
in
the
email body. The To: and Subject: fill in just great. any ideas
on
what
I
should change to get the field data to show in the email body
area?

Thanks for your help,
Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`


Try the following ...

Private Sub Command35_Click()

Dim strEmail as String
Dim strCompname As String

strEmail = Me!mbemail
strCompname = "Request: " & Nz([mbrequest1], "BLANK
FIELD")
&
vbCrLf
&
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT,
strEmail,
when
I
am
on
a
specific
record (this would be open in the form). Have the email
address,
field
name
"mbemail" go right into the To: position. Then
have
the
Subject
position
filled in with "Response to your request" this
would
be
the
same
for
all
emails. And the area I am having to most difficulty
with
is
the
body
area.
I want to have the request message repeated in the body.
This
would
be
field "mbrequest1", this way I don't have to cut and
paste.
I
could
then
type my response below this, and click send. Saves
time.

Here is my code.

Private Sub Command35_Click()
Dim strmbrequest1 As String
strCompname = "Request: " & Nz([mbrequest1], "BLANK
FIELD")
DoCmd.SendObject acSendNoObject, , acFormatTXT,
strEmail,
,
,
"Response
to
your request", _
strmbrequest1 & vbCrLf , True
End Sub

There maybe a better way of doing this. Any help or
suggestions
would
be
very helpful. Or if I am totally of base and
there
is coding,
and
 
Cheryl,

Thanks very much to you and Albert for checking the installation issues. I
up-dated my installations of Office 2003 which was only minor because I
normally check that regularly. I went and checked my installation of Access
and that was fine. Rebooted and tried it again and still the same problem,
nothing in the email body.

So, since I was on installation issues it got me thinking about the changes
we have made in our network systems lately. We have had major problem with
our networks during the past several months and IT just installed all the
new switches and routers this week, so now we a very fast and reliable.
That wasn't it. But, we have made major up-grades to our Exchange Server
for email just recently, and that I what I believe it is. Ever since we
made the changes I cannot forward emails that do not come from that server.
I manage 10 email addresses only half are from our server, the rest are
outside servers. Plus, when I go to News Groups I use Outlook Express, and
I can't forward a email with the body not being empty just like our Access
Problem. Funny how all this comes together.

So, I rebooted my machine got completely off the network, used my dial-up
connection to get to the Internet. Started MS Outlook 2003 with it being
offline, Opened Outlook Express. All works NOW just like it is suppose to.

I just now made a network connection back, ran my database from the network
like normal, had Outlook 2003 still in the offline setting, and my access
database worked just fine, with the email body filling in. To me this means
we have some settings issues in Exchange Server and how it is controlling
Outlook 2003.

I just need to now convince out IT department that that is the problem. I
have told them before about the forwarding problem, but they say they have
not changed anything and it must be me.

Cheryl, I cannot thank you enough for sticking with me on this problem, and
all the time you have spent on it. I know I have learned a lot during this
process.

Once I get this solved I will post what we did it fix it.

Thanks very very much,
Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Cheryl Fischer said:
Mike,

I got Office 2003 fully installed late last night. Created a database and
a form and ran the code in question. As Albert reports, the code ran
without flaw and placed the string in the body of the email.

For whatever it's worth, here are some of the parameters:

Office 2003: Did a custom install, selecting Run All From My Computer for
each of the component products.

Outlook 2003: After setting up email account, no other settings were
changed.

Mail Format Settings: "Compose in this message format:" HTML
Use Word 2003 as email editor: True

Operating System: Windows XP Pro, SP1 with all security patches applied.
See here to scan your system's status:
http://v4.windowsupdate.microsoft.com/en/default.asp

Other: Access Version 2.0, Office 97 Pro and Office 2000 Pro also
installed on that system.


Sorry, I cannot provide more info or positive results.
--

Cheryl Fischer, MVP Microsoft Access



MikeB said:
Thanks very much.
Mike

~~~~~~~~~~~~~~~~~~~~~


Name is
was but
as
FIELD")
state
strCompname,
,
True

to:

DoCmd.SendObject acSendNoObject, , , strEmail, , , "Your
Link-Belt Preferred Application", _ strCompname, True

--

Cheryl Fischer, MVP Microsoft Access



Cherly,

I think the problem seems to be in that line. Here is what my
code
looks
like now.

Private Sub Command35_Click()

Dim strEmail As String
Dim strCompname As String

strEmail = Me!email

strCompname = "Company Name: " & Nz(Me!compname, "BLANK
FIELD")
&
vbCrLf
&
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail, , ,
"Your
Link-Belt Preferred Application", _ strCompname, , True

End Sub

I gave you a bad field name that I have changed. The field
I
want
to
show
up in the body is compname, which stands for Company Name. See
the
change
above. Also, what is wierd is if I change the, ", , ," after
strEmail,
then
the Company Name will show in the Subject Line, and the Subject
will
show
in
the BCC. Now I understand how you determine what
information
goes
in
what
position in the email. Therefore I think the second to last line
is
correct
now, but the line,

strCompname = "Company Name: " & Nz(Me!compname, "BLANK
FIELD")
&
vbCrLf
&
vbCrLf

is what is giving me the problem for not showing. I tried this
line
both
ways you suggested and neither show up in the email body.

Thanks again,

Mike



~~~~~~~~~~~~~~~~~~~~`

Is the problem occurring with this line?

strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD")
&
vbCrLf
&
vbCrLf

If "mbrequest1" is the name of a control on your form, try this
modification
...

strCompname = "Request: " & Nz(Me!mbrequest1, "BLANK
FIELD")
&
vbCrLf
&
vbCrLf


Let me know ...
--

Cheryl Fischer, MVP Microsoft Access



Cherly,

Thanks. The only thing not working is placing the field
information
in
the
email body. The To: and Subject: fill in just great. any
ideas
on
what
I
should change to get the field data to show in the email body
area?

Thanks for your help,
Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`


message
Try the following ...

Private Sub Command35_Click()

Dim strEmail as String
Dim strCompname As String

strEmail = Me!mbemail
strCompname = "Request: " & Nz([mbrequest1], "BLANK FIELD")
&
vbCrLf
&
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT,
strEmail,
,
,
"Response
to
your request", _
strCompname, True

End Sub


--

Cheryl Fischer, MVP Microsoft Access




Cheryl,

I may be confused, and that's not hard to do for me since
I
am
new
at
this,
but isn't that the method I am using below. Or am I using
the
SendObject
in
the wrong way from what you are talking about.
Thanks
for
your
replay,
please let me kow where I have gone in the wrong
direction.

Thanks,
Mike

~~~~~~~~~~~~~~~~



message
Mike,

Have you looked at the SendObject method? While
primarily
used
to
send
Access objects such as tables, queries, reports,
it
can
certainly
be
used
without sending an object.

--

Cheryl Fischer, MVP Microsoft Access




I would like to create a email from a form button.
How
it
the
best
way
to
do this?

Here is what I would like to see happen. Click a
button
to
open
a
email
window (I use Outlook 2003). From my database
when
I
am
on
a
specific
record (this would be open in the form). Have the
email
address,
field
name
"mbemail" go right into the To: position. Then have
the
Subject
position
filled in with "Response to your request" this would
be
the
same
for
all
emails. And the area I am having to most difficulty
with
is
the
body
area.
I want to have the request message repeated in the
body.
This
would
be
field "mbrequest1", this way I don't have to cut and
paste.
I
could
then
type my response below this, and click send. Saves
time.

Here is my code.

Private Sub Command35_Click()
Dim strmbrequest1 As String
strCompname = "Request: " & Nz([mbrequest1], "BLANK
FIELD")
DoCmd.SendObject acSendNoObject, , acFormatTXT,
strEmail,
,
,
"Response
to
your request", _
strmbrequest1 & vbCrLf , True
End Sub

There maybe a better way of doing this. Any
help
 
Good investigating, Mike.



--

Cheryl Fischer, MVP Microsoft Access



MikeB said:
Cheryl,

Thanks very much to you and Albert for checking the installation issues. I
up-dated my installations of Office 2003 which was only minor because I
normally check that regularly. I went and checked my installation of Access
and that was fine. Rebooted and tried it again and still the same problem,
nothing in the email body.

So, since I was on installation issues it got me thinking about the changes
we have made in our network systems lately. We have had major problem with
our networks during the past several months and IT just installed all the
new switches and routers this week, so now we a very fast and reliable.
That wasn't it. But, we have made major up-grades to our Exchange Server
for email just recently, and that I what I believe it is. Ever since we
made the changes I cannot forward emails that do not come from that server.
I manage 10 email addresses only half are from our server, the rest are
outside servers. Plus, when I go to News Groups I use Outlook Express, and
I can't forward a email with the body not being empty just like our Access
Problem. Funny how all this comes together.

So, I rebooted my machine got completely off the network, used my dial-up
connection to get to the Internet. Started MS Outlook 2003 with it being
offline, Opened Outlook Express. All works NOW just like it is suppose to.

I just now made a network connection back, ran my database from the network
like normal, had Outlook 2003 still in the offline setting, and my access
database worked just fine, with the email body filling in. To me this means
we have some settings issues in Exchange Server and how it is controlling
Outlook 2003.

I just need to now convince out IT department that that is the problem. I
have told them before about the forwarding problem, but they say they have
not changed anything and it must be me.

Cheryl, I cannot thank you enough for sticking with me on this problem, and
all the time you have spent on it. I know I have learned a lot during this
process.

Once I get this solved I will post what we did it fix it.

Thanks very very much,
Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Cheryl Fischer said:
Mike,

I got Office 2003 fully installed late last night. Created a database and
a form and ran the code in question. As Albert reports, the code ran
without flaw and placed the string in the body of the email.

For whatever it's worth, here are some of the parameters:

Office 2003: Did a custom install, selecting Run All From My Computer for
each of the component products.

Outlook 2003: After setting up email account, no other settings were
changed.

Mail Format Settings: "Compose in this message format:" HTML
Use Word 2003 as email editor: True

Operating System: Windows XP Pro, SP1 with all security patches applied.
See here to scan your system's status:
http://v4.windowsupdate.microsoft.com/en/default.asp

Other: Access Version 2.0, Office 97 Pro and Office 2000 Pro also
installed on that system.


Sorry, I cannot provide more info or positive results.
--

Cheryl Fischer, MVP Microsoft Access



difference?
I
thought
is FIELD") state in
the strCompname,
what
,
field
I
want
to
show
up in the body is compname, which stands for Company Name. See
the
change
above. Also, what is wierd is if I change the, ", , ," after
strEmail,
then
the Company Name will show in the Subject Line, and the Subject
will
show
in
the BCC. Now I understand how you determine what information
goes
in
what
position in the email. Therefore I think the second to last
line
is
correct
now, but the line,

strCompname = "Company Name: " & Nz(Me!compname, "BLANK FIELD")
&
vbCrLf
&
vbCrLf

is what is giving me the problem for not showing. I tried
this
line
both
ways you suggested and neither show up in the email body.

Thanks again,

Mike



~~~~~~~~~~~~~~~~~~~~`

Is the problem occurring with this line?

strCompname = "Request: " & Nz([mbrequest1], "BLANK
FIELD")
&
vbCrLf
&
vbCrLf

If "mbrequest1" is the name of a control on your form, try
this
modification
...

strCompname = "Request: " & Nz(Me!mbrequest1, "BLANK
FIELD")
&
vbCrLf
&
vbCrLf


Let me know ...
--

Cheryl Fischer, MVP Microsoft Access



Cherly,

Thanks. The only thing not working is placing the field
information
in
the
email body. The To: and Subject: fill in just great. any
ideas
on
what
I
should change to get the field data to show in the email
body
area?

Thanks for your help,
Mike

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`


message
Try the following ...

Private Sub Command35_Click()

Dim strEmail as String
Dim strCompname As String

strEmail = Me!mbemail
strCompname = "Request: " & Nz([mbrequest1], "BLANK
FIELD")
&
vbCrLf
&
vbCrLf

DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmail,
,
,
"Response
to
your request", _
strCompname, True

End Sub


--

Cheryl Fischer, MVP Microsoft Access




Cheryl,

I may be confused, and that's not hard to do for me
since
I
am
new
at
this,
but isn't that the method I am using below. Or am I
using
the
SendObject
in
the wrong way from what you are talking about. Thanks
for
your
replay,
please let me kow where I have gone in the wrong
direction.

Thanks,
Mike

~~~~~~~~~~~~~~~~



"Cheryl Fischer" <[email protected]>
wrote
in
message
Mike,

Have you looked at the SendObject method? While
primarily
used
to
send
Access objects such as tables, queries, reports, it
can
certainly
be
used
without sending an object.

--

Cheryl Fischer, MVP Microsoft Access




I would like to create a email from a form button.
How
it
the
best
way
to
do this?

Here is what I would like to see happen.
Click
a
button
to
open
a
email
window (I use Outlook 2003). From my database when
I
am
on
a
specific
record (this would be open in the form). Have the
email
address,
field
name
"mbemail" go right into the To: position.
Then
have
the
Subject
position
filled in with "Response to your request" this
would
be
the
same
for
all
emails. And the area I am having to most difficulty
with
is
the
body
area.
I want to have the request message repeated in the
body.
This
would
be
field "mbrequest1", this way I don't have to
cut
and
paste.
I
could
then
type my response below this, and click send. Saves
time.

Here is my code.

Private Sub Command35_Click()
Dim strmbrequest1 As String
strCompname = "Request: " & Nz([mbrequest1], "BLANK
FIELD")
DoCmd.SendObject acSendNoObject, , acFormatTXT,
strEmail,
,
,
"Response
to
your request", _
strmbrequest1 & vbCrLf , True
End Sub

There maybe a better way of doing this. Any
help
or
suggestions
would
be
very helpful. Or if I am totally of base and there
is
a
better
way
please
let me know. I am still very new to Access coding,
and
work
a
lot
of
my
problems out be trying to see what others have done.

Thanks very much,
Mike
 
Back
Top