By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,948 Members | 1,929 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,948 IT Pros & Developers. It's quick & easy.

Sending Cheque table fields to Printer for Printing

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a
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

P: n/a
"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.