MS Access Forum / Modules / DAO / VBA / May 2008
How to copy/paste text from a form to email
|
|
Thread rating:  |
TomP - 12 May 2008 21:08 GMT I created a telephone log in MS Access and would like to know if there is a way I can copy my notes from a form in Access and past it to my email message automatically? Also, is there a way to have an entry added in my notes to indicate that an email was sent?
Thank you for your help,
Alex Dybenko - 13 May 2008 15:49 GMT Hi, have you tried docmd.SendObject ?
 Signature Best regards, ___________ Alex Dybenko (MVP) http://accessblog.net http://www.PointLtd.com
>I created a telephone log in MS Access and would like to know if there is a > way I can copy my notes from a form in Access and past it to my email [quoted text clipped - 3 lines] > > Thank you for your help, TomP - 13 May 2008 17:35 GMT Yes, here is what I have so far (see below). I would like to do two things.
First: I would like to copy text data from the textbox field in my form to "Ref: textfromform".
Second: I would like to have MS Access automatically pass additional information on my form annotating that an email was sent to a recipient with date and time email sent.
DoCmd.SendObject _ , _ , _ , _ " ", _ , _ , _ "Ref: ", _ " ", _ True
> Hi, > have you tried docmd.SendObject ? [quoted text clipped - 6 lines] > > > > Thank you for your help, Alex Dybenko - 14 May 2008 09:47 GMT 1. just add a reference to your textbox: "Ref: " & forms!MyForm!textfromform
2. You can run update query to set date/time in appropriate table after docmd.sendobject
 Signature Best regards, ___________ Alex Dybenko (MVP) http://accessblog.net http://www.PointLtd.com
> Yes, here is what I have so far (see below). I would like to do two > things. [quoted text clipped - 31 lines] >> > >> > Thank you for your help, TomP - 14 May 2008 15:30 GMT I'm sorry, but I'm slow on this.
1. I want to copy/paste a value in my current form on the subject liine of my email. The name of the textbox in my form is called Number. Am I supposed to include that information after the line entry ..... "Ref: ", _ ... which alread shows up in my email?
2. In my current form, I have a textbox called Notes. How do I add a one-line entry to include date/time email was sent?
> 1. just add a reference to your textbox: > "Ref: " & forms!MyForm!textfromform [quoted text clipped - 37 lines] > >> > > >> > Thank you for your help, Alex Dybenko - 15 May 2008 05:49 GMT > 1. I want to copy/paste a value in my current form on the subject liine > of > my email. The name of the textbox in my form is called Number. Am I > supposed to include that information after the line entry ..... "Ref: ", _ > ... which alread shows up in my email? so in your sendobject metod instead if "Ref:" write "Ref:" & forms!MyForm!Number
MyForm - should be a name of your form, if you run this from class behind form - you can use Me!Number
> 2. In my current form, I have a textbox called Notes. How do I add a > one-line entry to include date/time email was sent? run a query with following SQL: Update mytable set [Notes]=[Notes] & ', ' & Now() Where Number= forms!MyForm!Number
 Signature Best regards, ___________ Alex Dybenko (MVP) http://accessblog.net http://www.PointLtd.com
>> 1. just add a reference to your textbox: >> "Ref: " & forms!MyForm!textfromform [quoted text clipped - 41 lines] >> >> > >> >> > Thank you for your help, TomP - 16 May 2008 14:58 GMT Thank you for your help! I got the first part done. I'm having problems with the SQL part. Here is what I wrote. The name of my table is called Master and the name of my form is called Telephone. After the email is sent, I want to update the notes field on the form. Here is what I tried. I'm not clear what goes in the question marks. I just want the notes field in the form to include that an email was sent.
Thank you!
Dim SQL As String
SQL = Update tblmaster set [notes]=[notes] & ',' & Now() where ???
> > 1. I want to copy/paste a value in my current form on the subject liine > > of [quoted text clipped - 60 lines] > >> >> > > >> >> > Thank you for your help, Alex Dybenko - 17 May 2008 06:31 GMT Hi, if primary key of tblmaster is ID then it will be:
SQL = "Update tblmaster set [notes]=[notes] & ',' & Now() where ID=" & forms!Telephone!ID
docmd.runsql SQL
 Signature Best regards, ___________ Alex Dybenko (MVP) http://accessblog.net http://www.PointLtd.com
> Thank you for your help! I got the first part done. I'm having problems > with the SQL part. Here is what I wrote. The name of my table is called [quoted text clipped - 81 lines] >> >> >> > >> >> >> > Thank you for your help, TomP - 20 May 2008 13:38 GMT Thank you so much for your help! It works ... :-)
I have one last question on the SQL portion.... I hope....
What do I have to do to have the notes field automatically update the "notes" field on the form after an email is sent? What I'm doing right now is I click inside the "notes" field on the form to finish the SQL process. I am using a command button on this process.
Thank you,
> Hi, > if primary key of tblmaster is ID then it will be: [quoted text clipped - 89 lines] > >> >> >> > > >> >> >> > Thank you for your help, Alex Dybenko - 20 May 2008 13:56 GMT Hi I think you need to add docmd.runsql just after DoCmd.SendObject
 Signature Best regards, ___________ Alex Dybenko (MVP) http://accessblog.net http://www.PointLtd.com
> Thank you so much for your help! It works ... :-) > [quoted text clipped - 114 lines] >> >> >> >> > >> >> >> >> > Thank you for your help, TomP - 20 May 2008 17:43 GMT Hello:
I already have the docmd.runsql placed after the DoCmd.SendObject. This is what I did to have the "notes" field automatically to update. I added me.notes.setfocus at the end ... which worked! :-)
Is there an easy way to add the person's email address to in the SQL statement below?
SQL = "Update tblmaster set [notes]=[notes] & ',' & Now() where ID=" & forms!Telephone!ID
docmd.runsql SQL
> Hi > I think you need to add docmd.runsql just after DoCmd.SendObject [quoted text clipped - 117 lines] > >> >> >> >> > > >> >> >> >> > Thank you for your help, Alex Dybenko - 21 May 2008 13:35 GMT yes, sure:
SQL = "Update tblmaster set [notes]=[notes] & ',' & Now() & ', ' & '" & forms!Telephone!Email & "' where ID=" & forms!Telephone!ID
where Email - is a textbox on the same form
 Signature Best regards, ___________ Alex Dybenko (MVP) http://accessblog.net http://www.PointLtd.com
> Hello: > [quoted text clipped - 144 lines] >> >> >> >> >> > >> >> >> >> >> > Thank you for your help, TomP - 21 May 2008 16:19 GMT I was hoping that the SQL would just copy the email address information typed by the user rather than using a combo and/or textbox from MS Access. Is that possible? If so, how can be written?
Thank you again for your help!
> yes, sure: > [quoted text clipped - 151 lines] > >> >> >> >> >> > > >> >> >> >> >> > Thank you for your help, Alex Dybenko - 22 May 2008 10:43 GMT Type where? in outlook message? hmm, then I think it would be really tricky...
 Signature Best regards, ___________ Alex Dybenko (MVP) http://accessblog.net http://www.PointLtd.com
>I was hoping that the SQL would just copy the email address information >typed [quoted text clipped - 176 lines] >> >> >> >> >> >> > >> >> >> >> >> >> > Thank you for your help, TomP - 22 May 2008 13:00 GMT I think you're right....silly me... Anyway, I really appreciate your time and assistance on this topic...
Take care!
Tom
> Type where? in outlook message? hmm, then I think it would be really > tricky... [quoted text clipped - 179 lines] > >> >> >> >> >> >> > > >> >> >> >> >> >> > Thank you for your help,
|
|
|