Exporting Tables/Queries

D

Denver

There are instances that my boss would like to see data of my db from table
or queries in excel sheets or in PDF...so i exported it from access to excel
or PDF...
i dont want to export evertime my boss asking me in this way.. i have
already exported my data from access to excel...is there anyway i can update
that excel or PDF like everytime i add records on my db it also adds data on
the excel or in PDF?
is this possible?how? do i need codes? what would be codes looks like?

thanks

denver
 
J

John W. Vinson

There are instances that my boss would like to see data of my db from table
or queries in excel sheets or in PDF...so i exported it from access to excel
or PDF...
i dont want to export evertime my boss asking me in this way.. i have
already exported my data from access to excel...is there anyway i can update
that excel or PDF like everytime i add records on my db it also adds data on
the excel or in PDF?

Excel... maybe. PDF definitely no.
is this possible?how? do i need codes? what would be codes looks like?

A Spreadsheet can be linked to an Access table, but it's then not really a
spreadsheet any more (you wouldn't be able to add columns or rearrange them,
for example).
 
T

Tom Wickerath

S

Steve Schapel

Denver,

Do you realise also that the process of outputting your data to a
spreadsheet or PDF file can be considerably automated? One click on a
button whenever you want. Or automatically done at regular intervals,
as a scheduled task or on the Timer event of a form within your
database. If your concern is to avoid going to the bother of exporting
the data, it can be made pretty easy.
 
D

Denver

pls if you can guide through that it would be great.... or can you give me
any link of dowloaded samples so that i can work it...

thanks

denver
 
J

John W. Vinson

pls if you can guide through that it would be great.... or can you give me
any link of dowloaded samples so that i can work it...

For starters, open the VBA editor and search for help on the
"TransferSpreadsheet" method. There is an example in the help file describing
how to programmatically export data to a sheet.
 
D

Denver

i have a command button that exports my Report to PDF..but i dont know how to
start. anyone can help me with this?

thanks

denver
 
D

Denver

i dont know how to start making my codes in exporting my report to PDF
(cmdExport PDF)...
i have already a list box(lstReports) that list all the reports that i have..
i have check box(chkPreview) and (cmdReport)...that when i select lstReports
and click (chkPreview) and (cmdReport) it display the selected reports.. iam
using the Callback function....what i want is to write a code for my Export
PDF command button? but i dont know how to start? and how i can link my
Export PDF command button to the Callback function i have? anyone can help me?

i appreciate your response thanks a lot...
 
T

Tom Wickerath

Which version of Access are you using? Access 2007 includes the ability to
export to .pdf natively. Access 2003 and earlier does not include this
capability. Access MVP Tony Toews has a page on his web site dedicated to
this topic:

Creating PDF files from within Microsoft Access
http://www.granite.ab.ca/access/pdffiles.htm

He includes a link to Access MVP Stephen Lebans' "ReportToPDF" sample, which
you can download and have a look at (reverse engineer) to see how it works.
I've also heard good things about CutePDF, although I've never used it myself.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
D

Denver

so it means that creating a buttong to Export report in PDf is not possible..
Yes, I am using access 2003

thanks
 
D

Denver

Hello Tom,
I have seen the sample of exporting excel from the link you give me...
i want to use callback function so that i have a list of all my queries and
have the ability to export to excel to any of my queries? is this possibel?...
i am using already a calback function on my reports...so i want also to use
it on my queries?
 
J

John Spencer

No, it is possible to export a report to PDF.

You need to go to Stephen Lebans site and download the PDF example database
and dll's

http://www.lebans.com/reporttopdf.htm

Then to make this work, you will need to copy the code into your application
and install the two dll files along with your application.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
T

Tom Wickerath

Hi Denver,

It sounds to me like you just need a listbox, with the appropriate SQL
statement to serve as the Row Source, to list the queries you want to be able
to export. Then, you would use VBA code to determine which query was
selected. The method used will depend on whether you have the multiselect
property set to None (ie. only one item can be selected at a time), or you
have this property set to allow multiple selections (ie. Simple or Extended).

I think this SQL statement is likely a good choice for the row source of the
list box:

SELECT MsysObjects.Name AS ObjectName
FROM MsysObjects
WHERE Left$([Name],1)<>"~"
AND Left$([Name],4)<>"Msys"
AND MsysObjects.Type=5
AND MsysObjects.Flags In (0,16,112,128,2097152)
ORDER BY MsysObjects.Name;

Reference: Reply by Access MVP Dirk Goldgar in this past thread
http://groups.google.com/group/micr..._frm/thread/266a7e90df95e0ff/dce7b6bfb154626a

Are you sure your use of the term "callback function" is accurate? Here is a
definition I just found in Wikipedia:

http://en.wikipedia.org/wiki/Callback_function

I've heard people use the term Callback Function when talking about how to
add certain functionality to a custom ribbon in Access 2007, but I'm not sure
your use of this term is correct.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
K

Kenny Right

so, r u MVP?what`s MVP here.
SQL, I hate it so.

Tom Wickerath said:
Hi Denver,

It sounds to me like you just need a listbox, with the appropriate SQL
statement to serve as the Row Source, to list the queries you want to be
able
to export. Then, you would use VBA code to determine which query was
selected. The method used will depend on whether you have the multiselect
property set to None (ie. only one item can be selected at a time), or you
have this property set to allow multiple selections (ie. Simple or
Extended).

I think this SQL statement is likely a good choice for the row source of
the
list box:

SELECT MsysObjects.Name AS ObjectName
FROM MsysObjects
WHERE Left$([Name],1)<>"~"
AND Left$([Name],4)<>"Msys"
AND MsysObjects.Type=5
AND MsysObjects.Flags In (0,16,112,128,2097152)
ORDER BY MsysObjects.Name;

Reference: Reply by Access MVP Dirk Goldgar in this past thread:
http://groups.google.com/group/micr..._frm/thread/266a7e90df95e0ff/dce7b6bfb154626a

Are you sure your use of the term "callback function" is accurate? Here is
a
definition I just found in Wikipedia:

http://en.wikipedia.org/wiki/Callback_function

I've heard people use the term Callback Function when talking about how to
add certain functionality to a custom ribbon in Access 2007, but I'm not
sure
your use of this term is correct.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

Denver said:
Hello Tom,
I have seen the sample of exporting excel from the link you give me...
i want to use callback function so that i have a list of all my queries
and
have the ability to export to excel to any of my queries? is this
possibel?...
i am using already a callback function on my reports...so i want also to
use
it on my queries?
 
T

Tom Wickerath

Hi Kenny,
so, r u MVP?
Yes.

what`s MVP here.

See these links for more information:
https://mvp.support.microsoft.com/gp/mvpintro
https://mvp.support.microsoft.com/gp/mvpfaqs

SQL, I hate it so.

I'm sorry to hear that. If that's really true, then perhaps working with
database software is not your cup of tea.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 

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