export specified text formats access97 (resolution)

kflick

Registered User.
Local time
Yesterday, 17:29
Joined
Aug 19, 2002
Messages
10
First off

Don't reply to people who are trying to help with a pissy attitude!

so again i appologise for being an ass:(

I ended up using code to do the formatting required.

Open "testfile.txt" For Output As #1
Set rst = db.OpenRecordset(sql)
rst.MoveLast
cnt = rst.RecordCount
cntr = cnt

rst.MoveFirst

While cntr <> 0

ournum = rst!din
itnum = rst!itemnum
brndnm = Format(rst![comments 2], "!@@@@@@@@@@@@@@@")
mfpdnm = Format(rst!mfgpdnum, "@@@@@@@@@@")
pksz = Format(rst![comments 3], "!@@@@@@@@@@@@@@@")
desc = rst![comments 1]
scc = Format(rst!scccode, "@ @@ @@@@@ @@@@@ @")
upc = Format(rst!upccode, "@ @@@@@ @@@@@ @")
prc = Format(rst!price, "000000000")
sprc = Str(prc)

cntr = cntr - 1
Print #1, (ournum) & (itnum) & (brndnm) & (mfpdnm) & (pksz) & (desc) & (scc) & (upc) & (prc)
rst.MoveNext
Wend
Close #1

thanks to you who tried to help
thnder_mutt
 
You didn't get a pissy attitude to your other post. You got direction. As The_Doc_Man replied to your other post, a query that uses the Format() function to format the fields would have solved your problem.

Select din AS ournum, itemnum AS itnum, Format([comments 2], "!@@@@@@@@@@@@@@@") AS brndnm, Format(mfgpdnum, "@@@@@@@@@@") AS mfpdnm, .....

Then you would export the query rather than the table using the TransferText Method.
 
You misunderstood me

I was appologizing for ME being pissy. Doc was just trying to help.

I was using the export query method as described but it failed to work for me

on the last feild becauase it was numeric i think. The export insisted on adding a decmal and 2 zeros to my last field. I needed the leading zeros so i couldn't use a text field. to display that info.

After having made the effort to export the data as I showed. I will probably have more control in the long run

sorry for any confusion

Doc was fine it was me
 
Since I work in a government environment, I'm rather used to being lashed with wet noodles, bopped with rubber chickens, and generally being the target of scorn. Your minor grumble was like water off a duck's back.

But seriously, here's a thought. You say you used the Help files. But what if you didn't happen to recognize the one topic that would have really helped you? I just pointed to something that would do the trick. I don't deny that you use help files, but sometimes the thing you needed to know isn't under the topic you would have guessed it would be. You might be surprised at just how often that really is the case here.

And Pat is right. In the long run, just do your formats in the query rather than writing code. Then export the query. Save code for something that is truly in and of itself so ugly that nothing else will save it.
 
I have a challenge for you

send me a text file with a 9 digit number;
-no decimal
-decimal places
-with leading zeros
-exported from a numeric field.

( It has to do be numeric because it is a calculated value.)

(price - cost)
units = unit price

all * 100 and trucated at the decimal point

If you can do it I would like to know how it was done

thanks
again
 
oh oh

are you suggesting that I modify the sql statement of the basic select query that I create?

I don't remember seeing any format statements in the sql statement after building it and formating the feilds in the statement builder GUI thingy, but then I never looked.




I never thought of that!

I was attempting to control the format in the export utility



Only the brave challenge thier limits !
 
>I needed the leading zeros so i couldn't use a text field. to display that info. <

Actually, this is a contradiction.
You'll NEED a text field as you can't have leading zero's in a numeric field (that's why it's numeric, just elementary mathematics).

Rather then challenging the forum members (which isn't going to work cause it's your problem), try to explain why Doc's previous solution didn't work for you.

RV
 
send me a text file with a 9 digit number;
-no decimal
-decimal places
-with leading zeros
-exported from a numeric field.

Format(CLng(YourNum *100),"000000000")
 
hmm...

I have appologzed for what I thought was and my rudeness.

I presented the challenge for fun (If its a big deal - forget it).

I have a solution that works for me.

I am a bad person. And probably stupid too.

RV I'm sure Doc and Pat appreciate your protection. But if you don't have anything positive to contribe why are you joining in this discussion?

Can I ask what your point is?

I thought I was fairly clear that even after attempting to do as advised by doc and Pat that I was unsuccessful. Why would I know why thier advice didn't work? I asked for clarification of on the matter of the SQL statement. I didn't see where you attempted to clarify anything.

I have also indicated that I have a solution. This is a discussion forum an exchange of information or ideas.

If no one is intrested in responding to my questions or my responces to thier advice - so be it.

Only the brave challenge thier limits ! (reflects my attitude it wasn't intended to belittle anyone or shame anyone into doing something for me)

So if your intrested - respond. If not - ingore any future postings.

Thanks again to those who tried to help

Sincerely

thnder_mutt


Ps Thanks Pat

I see an answer in your post

Where do i put that statement in the sql view or in the properties of the query field?


I sent this one any ways
 
kflick,

First, I'm not protecting anybody.
Secondly, no one here was effended by your potst here, so why apologize?
A lot a people are guiding themselves "blindfolded" in a direction cause there aren't objective (anymore) to whatever they try to achieve.

Guess you're just one of those "blindfolded horses" sometimes (as most people are :D).
After all, we're only human.

RV
 
Put it in a query or in the controlsource of a control on a report:

Select Format(CLng(YourNum *100),"000000000") As OutFld
From YourTable;

or in a controlsource:

=Format(CLng(YourNum *100),"000000000")
 

Users who are viewing this thread

Back
Top Bottom