Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File Export Question 1

Status
Not open for further replies.

Ktx7ca

IS-IT--Management
Apr 5, 2008
88
CA
I have all the basic data in a table. With Fields Like number, name, publisher, tile etc

But I need export it as shown below with the 5 charater prefix before each of the requied fields to a text file

Any sugestions, Ideas, samples, Welcomed

BOOK|47131x
TRAN|D
ANAM|Toynbee, Arnold J.
TNAM|East to west: a Journey Round the World
PBLS|Oxford University Press
DESC|Hardcover. Sound, clean & nice copy, hint of edgewear. Jacket is bright & clean,light rubbing/edgewear. Price clipped. Small tear at top of jacket spine.
PRIC|5
JACK|J
BIND|H
UPDT|4/2/2008
UPTM|1:02:05 PM
BCAT|History
ABLE|1
ISBN|
UBID|189668
JCKC|Good
BNDC|Hard Cover
PBPL|New York
PBYR|1958
BOOC|Good
SIZE|8vo
STAT|Sold
PPRC|8.5
PDSC|amazon
LOCA|History: World
BOOE|
BOOS|
 
First, a couple of questions. 1 - you mentioned a 5 character prefix - I see 4 characters and a pipe - are you including the pipe as a character? 2 - where are you getting the prefix values from? are they the first 4 characters of the field name, are they static?
 
HI Lewathkin

Yes I was including the pipe as the 5th charater

The prefix values are not part of the field names
they are static, the computer I'm sending the file to uses then to sort the data to the correct location

Chris
 
This is really ugly but
Code:
Select "BOOK|" & [Number] As [BookNum],
       "TRAN|" & [Tran}   As [TranNum],
       "ANAM|" & [Author] As [AuthNum],
       "TNAM|" & [Title]  As [TitleNum], 
[blue]etc.[/blue]
where [Number]. [Tran], [Author], etc. are your field names.
 
I created a simple app - if you understand VBA should be pretty self explanatory. It is pretty ugly though and I would normally do things a little different. Understand that I do not know your database layout, fieldnames etc. Even if you don't use it, hopefully it'll give you some ideas. Let me know if you have any questions. You can download the database at:


Good Luck

Lee
 
HI Lee Thanks so much for your help It works great

chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top