send object

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

Guest

Hello People

I have Database and i have in it form so when i run this form i just fill
few combo box and fields, then press "submit email", and when u press "submit
email" it will run macro to run SendObject and that will run outlook.

My question i want one of the combo box let call it "combo box1" and one of
the fields let call it " Field1" to be the Subject of email? so what ever i
select from the "combo box1" and "field1" to be show up in Subject of email
when i press "submit email"

Thanks you all and i i will be looking forward to hear from you.
 
SendObject has the following arguments:

DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][,
bcc][, subject][, messagetext][, editmessage][, templatefile]

so the seventh argument is the one you want, and it should look like:

DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][,
bcc], Me.[combo box1] & " " & Me.[field1], messagetext][, editmessage][,
templatefile]
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Hi Arvin Meyer

Thanks for getting back to me.

I am new using access so i just would like to ask few questions about your
answer?

(1) me.[combo box1], Does "me." mean form name?

(2) see where u said--- DoCmd.SendObject [objecttype][, objectname][,
outputformat][, to][, cc][, bcc], Me.[combo box1] & " " & Me.[field1],
messagetext][,editmessage][,templatefile]

So all i have to do is fill in the argument of subject with " Me.[combo
box1] & " " & Me.[field1]"?

Thank you again and i will be looking forward to hear from u again.


Arvin Meyer said:
SendObject has the following arguments:

DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][,
bcc][, subject][, messagetext][, editmessage][, templatefile]

so the seventh argument is the one you want, and it should look like:

DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][,
bcc], Me.[combo box1] & " " & Me.[field1], messagetext][, editmessage][,
templatefile]
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

Hassan Merzha said:
Hello People

I have Database and i have in it form so when i run this form i just fill
few combo box and fields, then press "submit email", and when u press
"submit
email" it will run macro to run SendObject and that will run outlook.

My question i want one of the combo box let call it "combo box1" and one
of
the fields let call it " Field1" to be the Subject of email? so what ever
i
select from the "combo box1" and "field1" to be show up in Subject of
email
when i press "submit email"

Thanks you all and i i will be looking forward to hear from you.
 
I have tried it but it did not work, when i enter the code in the argument of
subject. nothing happen and when i run the macro it show the code in the
subject field?

Hassan Merzha said:
Hi Arvin Meyer

Thanks for getting back to me.

I am new using access so i just would like to ask few questions about your
answer?

(1) me.[combo box1], Does "me." mean form name?

(2) see where u said--- DoCmd.SendObject [objecttype][, objectname][,
outputformat][, to][, cc][, bcc], Me.[combo box1] & " " & Me.[field1],
messagetext][,editmessage][,templatefile]

So all i have to do is fill in the argument of subject with " Me.[combo
box1] & " " & Me.[field1]"?

Thank you again and i will be looking forward to hear from u again.


Arvin Meyer said:
SendObject has the following arguments:

DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][,
bcc][, subject][, messagetext][, editmessage][, templatefile]

so the seventh argument is the one you want, and it should look like:

DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][,
bcc], Me.[combo box1] & " " & Me.[field1], messagetext][, editmessage][,
templatefile]
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

Hassan Merzha said:
Hello People

I have Database and i have in it form so when i run this form i just fill
few combo box and fields, then press "submit email", and when u press
"submit
email" it will run macro to run SendObject and that will run outlook.

My question i want one of the combo box let call it "combo box1" and one
of
the fields let call it " Field1" to be the Subject of email? so what ever
i
select from the "combo box1" and "field1" to be show up in Subject of
email
when i press "submit email"

Thanks you all and i i will be looking forward to hear from you.
 
Answers inline:

Hassan Merzha said:
Hi Arvin Meyer

Thanks for getting back to me.

I am new using access so i just would like to ask few questions about your
answer?

(1) me.[combo box1], Does "me." mean form name?

Me is a keyword used in VBA code to refer to the currently running form or
report. It replaces:

Forms!FormName

for the current form (the one running the code).
(2) see where u said--- DoCmd.SendObject [objecttype][, objectname][,
outputformat][, to][, cc][, bcc], Me.[combo box1] & " " & Me.[field1],
messagetext][,editmessage][,templatefile]

So all i have to do is fill in the argument of subject with " Me.[combo
box1] & " " & Me.[field1]"?

The actual Code would probably look something like this (all on one line):

DoCmd.SendObject acSendTable, TableName, acFormatXLS, (e-mail address removed), ,
, Me.[combo box1] & " " & Me.[field1]
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top