 | 
28-Jul-2006, 08:04 AM
|  | Guest | | | | | | | | | | After I enter data in Form, I’d like them sent by email as .xls at Hi dear MVPs,
After I fill the form I would like to create a button that would email Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/9623-after-i-enter-data-form-i.html
current filled form to someone as an excel attachment, how would I do this?
Any help is greatly appreciated!
Thank you,
Adnan
--
Please post all your inquiries on this community so we can all benefit -
Thank you! * Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh! | 
28-Jul-2006, 08:04 AM
|  | Guest | | | | | | | | | | RE: After I enter data in Form, I’d like them sent by email as .xls at Hi Adnan,
> Hi dear MVPs,
You should not be restricting your question to MVP's. There are many people
who are regular contributors to this newsgroup, who are perfectly capable of Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9623
answering your question, but they are not MVP's. I was one of these people
until just April of this year.
1.) First, your form must include a primary key field, or a field set as a
unique index. This will give you a way to identify the particular record that
you wish to export.
2.) Create a new query that includes the fields you wish to export to your
Excel spreadsheet. This might include all of the fields in the form, or a
subset of the fields. Add a criteria for the primary key or unique index
field that points to the open form. Something like this:
Criteria: [Forms]![frmPeople]![CustomerID]
for a form that is named "frmPeople", and a unique indexed field named
"CustomerID". Name the query "qryExcelExport".
3.) Create a command button on your form, and name it something like
"cmdSendUsingExcel". Add the following code for the click event procedure of
this button:
Private Sub cmdSendUsingExcel_Click()
On Error GoTo ProcError
DoCmd.SendObject ObjectType:=acQuery, _
ObjectName:="qryExcelExport", _
OutputFormat:=acFormatXLS, EditMessage:=True
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure cmdSendUsingExcel_Click..."
Resume ExitProc
End Sub
If you have other information available on your form, such as the person's
e-mail address, you can add the optional "To:=" argument to the
DoCmd.SendObject statement.
Tom Wickerath, Microsoft Access MVP http://www.access.qbuilt.com/html/ex...tributors.html http://www.access.qbuilt.com/html/search.html
__________________________________________ Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9623
"Adnan" wrote:
> Hi dear MVPs,
> After I fill the form I would like to create a button that would email
> current filled form to someone as an excel attachment, how would I do this?
>
> Any help is greatly appreciated!
> Thank you,
> Adnan | 
28-Jul-2006, 08:04 AM
|  | Guest | | | | | | | | | | RE: After I enter data in Form, I’d like them sent by email as .xl Tom,
With the description I’ve provided this is exactly what I was looking for,
but there was something I didn’t previously mention, would it be possible to
email current records (export them first into my .xls format I already have
on my Desktop, also input these records into curtain cells such as: A4, A5,
etc not including deaders) and then e-mail it (have it attached and ready
uploaded on the email (outlook) body.
What I’m trying to do is, when a customer fills the form he/she can also
email it as an .xls attachment with a single click from an optional button
(with my .xls format).
P.S – Speaking of MVP’s, you are right, but I kind of consider/respect//call
these contributors MVP’s, too.
Congratulation/happy your new/additional recent title (MVP) ****
Thank you much Tom!
Adnan
--
Please post all your inquiries on this community so we can all benefit -
Thank you!
"Tom Wickerath" wrote:
> Hi Adnan,
>
> > Hi dear MVPs,
>
> You should not be restricting your question to MVP's. There are many people Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9623 Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9623
> who are regular contributors to this newsgroup, who are perfectly capable of
> answering your question, but they are not MVP's. I was one of these people
> until just April of this year.
>
> 1.) First, your form must include a primary key field, or a field set as a
> unique index. This will give you a way to identify the particular record that
> you wish to export.
>
> 2.) Create a new query that includes the fields you wish to export to your
> Excel spreadsheet. This might include all of the fields in the form, or a
> subset of the fields. Add a criteria for the primary key or unique index
> field that points to the open form. Something like this:
>
> Criteria: [Forms]![frmPeople]![CustomerID]
>
> for a form that is named "frmPeople", and a unique indexed field named
> "CustomerID". Name the query "qryExcelExport".
>
> 3.) Create a command button on your form, and name it something like
> "cmdSendUsingExcel". Add the following code for the click event procedure of
> this button:
>
> Private Sub cmdSendUsingExcel_Click()
> On Error GoTo ProcError
>
> DoCmd.SendObject ObjectType:=acQuery, _
> ObjectName:="qryExcelExport", _
> OutputFormat:=acFormatXLS, EditMessage:=True
>
> ExitProc:
> Exit Sub
> ProcError:
> MsgBox "Error " & Err.Number & ": " & Err.Description, _
> vbCritical, "Error in procedure cmdSendUsingExcel_Click..."
> Resume ExitProc
> End Sub
>
>
> If you have other information available on your form, such as the person's
> e-mail address, you can add the optional "To:=" argument to the
> DoCmd.SendObject statement.
>
>
> Tom Wickerath, Microsoft Access MVP
>
> http://www.access.qbuilt.com/html/ex...tributors.html
> http://www.access.qbuilt.com/html/search.html
> __________________________________________
>
> "Adnan" wrote:
>
> > Hi dear MVPs,
> > After I fill the form I would like to create a button that would email
> > current filled form to someone as an excel attachment, how would I do this?
> >
> > Any help is greatly appreciated!
> > Thank you,
> > Adnan | 
28-Jul-2006, 08:04 AM
|  | Guest | | | | | | | | | | RE: After I enter data in Form, I’d like them sent by email as .xl Hi Adnan,
You can do this, but not by using DoCmd.SendObject, since that is intended
to send an object (table, query, etc.) that is within your database. You'll
need to use Outlook, or some other e-mail client that exposes a programmable
object model. Outlook Express is ruled out in this case.
I suggest that you take a look at this article: http://msdn.microsoft.com/library/de..._ac_olauto.asp
You might also want to download the XP Automation Help file from Microsoft
(XPAutomation.chm): http://www.microsoft.com/downloads/d...DisplayLang=en
and perhaps this one:
Access 2003 Sample: Using Automation with Access and Outlook http://www.microsoft.com/downloads/d...DisplayLang=en
Finally, take a look at this thread to see if it gives you any useful ideas: http://www.microsoft.com/office/comm...2-2d7014c31602
Tom Wickerath, Microsoft Access MVP http://www.access.qbuilt.com/html/ex...tributors.html http://www.access.qbuilt.com/html/search.html
__________________________________________
"Adnan" wrote:
> Tom,
> With the description I’ve provided this is exactly what I was looking for,
> but there was something I didn’t previously mention, would it be possible to
> email current records (export them first into my .xls format I already have
> on my Desktop, also input these records into curtain cells such as: A4, A5,
> etc not including deaders) and then e-mail it (have it attached and ready
> uploaded on the email (outlook) body.
> Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9623
> What I’m trying to do is, when a customer fills the form he/she can also Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9623
> email it as an .xls attachment with a single click from an optional button
> (with my .xls format).
>
> P.S – Speaking of MVP’s, you are right, but I kind of consider/respect//call
> these contributors MVP’s, too.
>
> Congratulation/happy your new/additional recent title (MVP) ****
>
> Thank you much Tom!
> Adnan | 
28-Jul-2006, 08:04 AM
|  | Guest | | | | | | | | | | RE: After I enter data in Form, I’d like them sent by email as .xl I was thing of making a button to export current filled form’s data into a
saved excel spreadsheet then another button to email that excel saved
spreadsheet. I can do the second but not the first (exporting current data
into excel). I know I’ve seen some code for this somewhere in this community.
Got to search again…
Other then thin, you were greatly helpful. Thank you Tom,
Adnan, Computer Science Student
Kosovo
--
Please post all your inquiries on this community so we can all benefit -
Thank you!
"Tom Wickerath" wrote:
> Hi Adnan,
>
> You can do this, but not by using DoCmd.SendObject, since that is intended
> to send an object (table, query, etc.) that is within your database. You'll
> need to use Outlook, or some other e-mail client that exposes a programmable
> object model. Outlook Express is ruled out in this case.
>
> I suggest that you take a look at this article:
> http://msdn.microsoft.com/library/de..._ac_olauto.asp
>
> You might also want to download the XP Automation Help file from Microsoft
> (XPAutomation.chm):
> http://www.microsoft.com/downloads/d...DisplayLang=en
>
> and perhaps this one:
>
> Access 2003 Sample: Using Automation with Access and Outlook
> http://www.microsoft.com/downloads/d...DisplayLang=en
>
> Finally, take a look at this thread to see if it gives you any useful ideas:
> http://www.microsoft.com/office/comm...2-2d7014c31602
>
>
> Tom Wickerath, Microsoft Access MVP
>
> http://www.access.qbuilt.com/html/ex...tributors.html
> http://www.access.qbuilt.com/html/search.html
> __________________________________________
>
> "Adnan" wrote:
>
> > Tom,
> > With the description I’ve provided this is exactly what I was looking for,
> > but there was something I didn’t previously mention, would it be possible to
> > email current records (export them first into my .xls format I already have
> > on my Desktop, also input these records into curtain cells such as: A4, A5, Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9623
> > etc not including deaders) and then e-mail it (have it attached and ready
> > uploaded on the email (outlook) body.
> >
> > What I’m trying to do is, when a customer fills the form he/she can also
> > email it as an .xls attachment with a single click from an optional button
> > (with my .xls format).
> >
> > P.S – Speaking of MVP’s, you are right, but I kind of consider/respect//call Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9623
> > these contributors MVP’s, too.
> >
> > Congratulation/happy your new/additional recent title (MVP) ****
> >
> > Thank you much Tom!
> > Adnan | 
28-Jul-2006, 08:04 AM
|  | Guest | | | | | | | | | | Re: After I enter data in Form, I'd like them sent by email as .xl Don't forget to address the potential of a user forgetting to export
the data but still pressing the email button, thereby sending the
previously exported data instead of the current data. Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9623
(Don't enable the second button until the first one has been pressed.) | 
Support Us! Become a Promoter! | | Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh! | (View-All)
Members who have read this thread : 0
| | There are no names to display. | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Tools | Search | | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is On | | | | » Active Discussions | | | | | | | | | | | | | | | | | | | | | | | Panjabi Today 02:14 AM 9 Replies, 203 Views | | | | | | | » Books You Should Read... | | | |