Building a text file in Access (1 Viewer)

mtp

Registered User.
Local time
Today, 04:17
Joined
Dec 8, 2000
Messages
35
I want to build a text file in Access. This text file which I will use to print out a check for broker. And I don't know how to start it, does any one know how? Please help!!!Thank you.
 

Pat Hartman

Super Moderator
Staff member
Local time
, 23:17
Joined
Feb 19, 2002
Messages
43,603
Create a query that selects the fields you want to export in the order you want them to appear. Then use the File/Export wizard to build an export spec. Once you have done this once manually, you can save the export spec (press the advanced button) and then reference it from the TransferText Method or Action to automate the process.

The export wizard gives you the choice of comma delimited variable length files (.csv) or fixed with fields with no delimiters (.txt). Choose the option that you require.
 

mtp

Registered User.
Local time
Today, 04:17
Joined
Dec 8, 2000
Messages
35
Pat, can you explain more for me please? I totally don't know how to do it. My program has to do these things: first print out a statement of list who need to pay, then after the statement will print out the check of that list. The format for the text file I want to do for the check print out has to look like below (it looks like just the way a regular check though, please note the address is change depend on who to write the check to):


* * SEE ATTACHED STATEMENT * *

$ 1,083.96

$ 1,083.96

SEA-MOUNTAIN INSURANCE BROKERS
131-2ND AVENUE SOUTH
EDMONDS, WA 98020



The old program was written in DBase (they used Check Register software to print out the check)and now I'm rewrote in our language here which calls Omnis and the last part of this program is to print the check and I'm thinking of using Access to build a text file in Window to print out. Is that make sense? Please help if you have any ideas. Thank you!
 

Pat Hartman

Super Moderator
Staff member
Local time
, 23:17
Joined
Feb 19, 2002
Messages
43,603
Have you built the tables, forms, queries and reports that you need? What exactly are you having trouble with?

As to the export, if you are saying that the check writing program needs 8 RECORDS for each check, you will have to learn enough VBA to write a file described like that with one field for each record. I would have expected the check writing program to need 1 RECORD per check with 8 fields. The second type of file is very easy to make with Access but you've got to start somewhere. You can't use the File/export wizard until you have built a table and the appropriate query.
 

mtp

Registered User.
Local time
Today, 04:17
Joined
Dec 8, 2000
Messages
35
Pat, I have all the tables and queries to know what fields I need for. I tried what you said before and didn't get what I want. How do you build a text file then import into Access with a list of what you want to print out? Should I build a text file in Word? Note Pad? but then I couldn't get a list of what I want though. This is what I'm having troulble with. Or VB is a good start for building this file???
 

Surjer

Registered User.
Local time
Today, 04:17
Joined
Sep 17, 2001
Messages
232
What do you want you're "Text File" To look like?
 

mtp

Registered User.
Local time
Today, 04:17
Joined
Dec 8, 2000
Messages
35
The text file looks like the format above that I gave. And here's it again:

* * SEE ATTACHED STATEMENT * *

$ 1,083.96

$ 1,083.96

SEA-MOUNTAIN INSURANCE BROKERS
131-2ND AVENUE SOUTH
EDMONDS, WA 98020

All information should pull out from fields in tables and should print in a list of checks. Thanks for all your help, guys!
 

Surjer

Registered User.
Local time
Today, 04:17
Joined
Sep 17, 2001
Messages
232
1.Query the information you need
2.Build a report based on that query that has the Feilds all in the right places.
3.Output the Report To a text file using the Export Function...
In a Form It would look Like:private Sub Command4_Click()
On Error GoTo Err_Command4_Click

Dim stDocName As String

stDocName = "Generic Report"
DoCmd.OutputTo acReport, stDocName

Exit_Command4_Click:
Exit Sub

Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click

End Sub
 

Users who are viewing this thread

Top Bottom