Automating EXPORT

  • Thread starter Thread starter Mark R
  • Start date Start date
M

Mark R

I want to have a command button on a form that
automatically runs a query, "runs" a report, and exports
the report output to a .prt file in a specific directory,
then prints the report to a hardcopy using a specific
printer type HP5550 (though there are other printer types
available on the laptop, such as HP845) .

What CODE BUILDER code do I need to write?
 
Mark:

What you've asked for is not an easy chore.

1.) To run a query, its simple

Dim Cdb as DAO.Database
Set Cdb = CurrentDb()
Cdb.Execute ("Name of Your Query")

2.) Run a report

Docmd.OpenReport "Your Report Name" 'will send it to print

3.) Access has no built in capability to output a report to a printer file
(i.e. a prn file)

You can look at our Print To File Manager for Access, which exposes the
ability to output a report to a prn file or a postscript file depending on
the printer you want to use. It only requires one function call.

4.) Sending a prn file to a specific printer involves using a DOS command
based on where the printer is connected, if its a network printer, you
usually need to map the network location to a virutual LPT port. Then use
the Copy command as in Copy "c:\somedir\somefile.prn" LPT2: /b

HTH
 
What do you mean by
"look at our Print To File Manager for Access"

where do "I look at it"
is it a separate product to be purchased?
where do I purchase it?
How does it "expose" "the ability" to output to a prn
file?
Which function call is required?
 
Scary, I am getting the hang of this software.and for
your information, the CORRECT ANSWER IS:

just use the OUTPUT TO action on a macro

fill in object type: report
object name: HCFA0508
output format Text files
ouput file: C:nameoffile.prt
Encoding MS-DOS

now that's a complete answer
I keep wondering if those that answer these "POSTS"
are paid to answer by MICROSOFT because they have these
awesome initials and titles after their name like MVP;
Mr.ARbaugh, if you are an unpaid good samaritan, I then
humbly thank you and hope this will aide you in the
future.
 
Back
Top