473,394 Members | 1,787 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,394 software developers and data experts.

Sending Cheque table fields to Printer for Printing

Hi,

We are having a large cheque run printed by an outside printer. The
printer asked us to give him the layout of the fields to print on a
form and send it to him. As an example the form looks like this:

xxxxxxxxxxxxxxxxxx dd mm yyyy

xxxxxxxxxxxxxxxxxxxxxxx zzzzzzzzz.99

On a second form I sent the fields I want him to print on the above
form. Each number below represents a field name in a table (all fields
are text fields):

1 2
3 4

Field 1 = 18 characters
Field 2 = 10 characters
Field 3 = 23 characters
Field 4 = 12 characters
The printer asked that I send the data to him in a fixed length text
file with each record on a new line.

I know I must concatenate all the fields into one line. I must check
the length of each field to find out how many spaces to add to the
front or the end of each field in the record line.

Questions:
What is the best way to add spaces to the field in the line?
How do I output this to a text file?

Thanks,
Barry
www.witstoronto.ca

Aug 19 '07 #1
6 2222
You need to get the four fields into one query and then use the transfertext
method to create the fixed length text file.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
re******@pcdatasheet.com


"Barry Edmund Wright" <bw**************@sympatico.cawrote in message
news:11*********************@l22g2000prc.googlegro ups.com...
Hi,

We are having a large cheque run printed by an outside printer. The
printer asked us to give him the layout of the fields to print on a
form and send it to him. As an example the form looks like this:

xxxxxxxxxxxxxxxxxx dd mm yyyy

xxxxxxxxxxxxxxxxxxxxxxx zzzzzzzzz.99

On a second form I sent the fields I want him to print on the above
form. Each number below represents a field name in a table (all fields
are text fields):

1 2
3 4

Field 1 = 18 characters
Field 2 = 10 characters
Field 3 = 23 characters
Field 4 = 12 characters
The printer asked that I send the data to him in a fixed length text
file with each record on a new line.

I know I must concatenate all the fields into one line. I must check
the length of each field to find out how many spaces to add to the
front or the end of each field in the record line.

Questions:
What is the best way to add spaces to the field in the line?
How do I output this to a text file?

Thanks,
Barry
www.witstoronto.ca

Aug 19 '07 #2

"Steve" <so***@private.emailaddressschreef in bericht news:13*************@corp.supernews.com...
You need to get the four fields into one query and then use the transfertext
method to create the fixed length text file.

PC Datasheet
--
This is to inform 'newbees' here about PCD' Steve:
http://home.tiscali.nl/arracom/whoissteve.html
Until now 3500+ pageloads, 2300+ first-time visitors (these figures are rapidly increasing)

Why is this ???
Because Steve is the ONLY person here who continues to advertise in the groups.

It is not relevant whether he advertised in *this* particular post or not...
==We want him to know that these groups are *not* his private hunting grounds!

For those who don't like too see all these messages:
==Simply killfile 'StopThisAdvertising'.
Newbees will still see this warning-message.

ArnoR
Aug 19 '07 #3
On Sun, 19 Aug 2007 05:40:14 -0700, Barry Edmund Wright
<bw**************@sympatico.cawrote:
>Hi,

We are having a large cheque run printed by an outside printer. The
printer asked us to give him the layout of the fields to print on a
form and send it to him. As an example the form looks like this:

xxxxxxxxxxxxxxxxxx dd mm yyyy

xxxxxxxxxxxxxxxxxxxxxxx zzzzzzzzz.99

On a second form I sent the fields I want him to print on the above
form. Each number below represents a field name in a table (all fields
are text fields):

1 2
3 4

Field 1 = 18 characters
Field 2 = 10 characters
Field 3 = 23 characters
Field 4 = 12 characters
The printer asked that I send the data to him in a fixed length text
file with each record on a new line.

I know I must concatenate all the fields into one line. I must check
the length of each field to find out how many spaces to add to the
front or the end of each field in the record line.

Questions:
What is the best way to add spaces to the field in the line?
How do I output this to a text file?

Thanks,
Barry
www.witstoronto.ca
There are a lot of different ways of accomplishing this. It could be
done as a simple procedure that handles everything or you could create
a stored query that would format the data for you, then output that to
a file. The method that you use to get the data out to a file might
be dependant on your experience and comfort level.

For example:

SELECT
Left(Field1 & Space(18), 18) &
Left(Field2 & Space(10), 10) &
Left(Field3 & Space(23), 23) &
Left(Field4 & Space(12), 12)
FROM
Table1

would retrieve the data and format it as you describe above with fixed
widths. It could be output to a file or a report.

If you prefer to do it as a procedure, perhaps you should indicate if
you prefer working with DAO vs ADO or maybe what version of Access you
are working with. I think you'll find lots of help.
Aug 19 '07 #4
On Sun, 19 Aug 2007 14:16:00 -0400, Arch <se*****@spam.netwrote:
>
There are a lot of different ways of accomplishing this. It could be
done as a simple procedure that handles everything or you could create
a stored query that would format the data for you, then output that to
a file. The method that you use to get the data out to a file might
be dependant on your experience and comfort level.

For example:

SELECT
Left(Field1 & Space(18), 18) &
Left(Field2 & Space(10), 10) &
Left(Field3 & Space(23), 23) &
Left(Field4 & Space(12), 12)
FROM
Table1

would retrieve the data and format it as you describe above with fixed
widths. It could be output to a file or a report.

If you prefer to do it as a procedure, perhaps you should indicate if
you prefer working with DAO vs ADO or maybe what version of Access you
are working with. I think you'll find lots of help.
Barry, I neglected to mention this in my earlier reply, but that same
query could also handle formatting, if needed, for your date and
dollar amount fields.

Arch
Aug 19 '07 #5
"Barry Edmund Wright" <bw**************@sympatico.cawrote in message
Questions:
What is the best way to add spaces to the field in the line?
How do I output this to a text file?
The export data wizard allows you to export fixed length data, and also save
this "spec".

Build your query with the required fields that you need.

Then, export he query using the wizard, you see additional options for
specifying the length of each field....

You can likely create this export without wring any code.

Once you get it working, the you could of place a button on a form, and have
the whole process automatic....
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
Aug 19 '07 #6
On Aug 19, 4:14 pm, "Albert D. Kallal" <PleaseNOOOsPAMmkal...@msn.com>
wrote:
"Barry Edmund Wright" <bwright_msacc...@sympatico.cawrote in message
Questions:
What is the best way to add spaces to the field in the line?
How do I output this to a text file?

The export data wizard allows you to export fixed length data, and also save
this "spec".

Build your query with the required fields that you need.

Then, export he query using the wizard, you see additional options for
specifying the length of each field....

You can likely create this export without wring any code.

Once you get it working, the you could of place a button on a form, and have
the whole process automatic....

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKal...@msn.com
Thanks that worked great .... thanks!
Barry

Aug 27 '07 #7

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

Similar topics

0
by: KohlerTommy | last post by:
In my application I need to give the user the ability to print duplex if the selected printer supports duplex printing. Many of the printer options do not make much sense in my application, and...
0
by: Tessa | last post by:
Is there any security reason why you cannot print to a network printer from ASP.NET under IIS6 on Windows 2003 server? I'm using ASP.NET code to print to a server print queue using...
3
by: notregister | last post by:
Hi would i like to send string of PCL codes to a Printer which i have the IP address, how do i send it? i'm currently using TCPclient class, but it could not work, as the printer would just...
13
by: salad | last post by:
Hi Guys: I was stuck. I needed to send a report to a file. My beautiful report(s) in Access were going to require loss of formatting with RTFs, a PITA in WordMailMerge, sending it as a text...
1
by: Paul Aspinall | last post by:
Hi I'm writing a web based system, which needs to direct prints to a Zebra barcode printer. I plan to use the ZPL (Zebra's own) programming language for sending Raw ASCII to the printer, and...
0
by: John Smith | last post by:
Hello, I am developing a VB.NET 2003 application that will use lots of Crystal Reports. Sometimes the users will preview a report in a Crystal report viewer, and sometimes they will send the...
1
by: deric | last post by:
Hi! I'm new to VB.net programming on printing a page to a thermal printer (Epson T88IV). I really had a hard time figuring out how to code the printing of a bitmap image and some text, while sending...
0
by: Charles Crawford | last post by:
Hi, This apparently is a common problem and I've yet to read a solution that actually works for my specific situation. I have a Zebra RW220 printer that I connect to via Bluetooth connection...
0
by: =?Utf-8?B?Q2hhcmxpZQ==?= | last post by:
Hi, This apparently is a common problem and I've yet to read a solution that actually works for my specific situation. I have a Zebra RW220 printer that I connect to via Bluetooth connection...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.