473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Print a file in a database

I have a filenane defined in a table in my database. This filename
field is also displayed on my form. I have place a print button on my
form. I would like to be abel to click the Print button on the form
and print out the file defined in the filename field. How can I do
this?

I thought of using a DOS command on the Print button but not sure what
that command is. Thanks in advance.
Nov 13 '05 #1
1 1465
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Easy, old-style way using the Shell() function:

dim strCmd as string, strSource as string, strTarget as string

' Path to the source file
strSource = "C:\My Documents\myFile.txt"

' Set the target as the printer
strTarget = "PRN:"

' The DOS command to redirect the display of the source file
' to the printer device.
strCmd = "type " & strSource & " > " & strTarget

' Use the Shell function to carry out the DOS command
Shell strcmd, vbHide

Problems: If an error occurs you won't know it.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQRPXSYechKqOuFEgEQLf9wCggQK0hpcL3vgpVcsesSIKRE EWWwEAoPYg
AwAyqqRxU5R6Hk5GV3xnw67y
=5Gys
-----END PGP SIGNATURE-----
Brian Turner wrote:
I have a filenane defined in a table in my database. This filename
field is also displayed on my form. I have place a print button on my
form. I would like to be abel to click the Print button on the form
and print out the file defined in the filename field. How can I do
this?

I thought of using a DOS command on the Print button but not sure what
that command is. Thanks in advance.


Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Malcolm Cook | last post by:
I've discovered: Using "File > Print Preview" in a form's datasheet view with a server Filter crashes access after previewing... ....that is, unless ServerFilterByForm has been turned off...
16
by: John Baker | last post by:
HI; I feel like a fool..I put CUTE FTP in my last request for help --it should have been CUTE PDF! I have FTP on my mind because I have been working on a web based application, and somehow my...
4
by: =?Utf-8?B?UGF1bCBCdXp6YSwgb2xkc3RlciB1c2luZyBuZXcg | last post by:
I have developed a web-based inventory system for my estate jewelry business using ASP.Net 2.0 and Microsoft SQLServer. The inventory database is also the basis of my website...
6
by: Filips Benoit | last post by:
Dear All, All 3 codes, copied from internet, triggers error 429 : ActiveX component can't create object ! No compile error. I have the reference set to Adobe Acrobat 7.0 Type Library I do not...
3
by: Max58kl | last post by:
Trying to access data and print it to the screen using Perl Builders I/O Window -------------------------------------------------------------------------------- Hi I am using a program called...
8
tdw
by: tdw | last post by:
Hi, I have searched for this answer to no avail. I've found some very similar questions, but no answers that seem to apply. Here's the deal: All reports work fine on my computer. My boss,...
12
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to...
10
by: S_K | last post by:
Hi, I have a directory full of a number of .PDF files that I need to print. Is there any simple way to do this? Using PdfReader purhaps? Thanks in advance. Steve
2
by: crazyhouse | last post by:
Hi, I dont even know where to start on this one. I found this on the net (everything in italics are the authors comments): Public Function OpenFirstAttachmentAsTempFile(ByRef rstCurrent As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.