Writing to a file using the VBA Print statement - no space separators

When creating a file with MS Access that will be used with QuickBooks IIF, I need a tab delimited file, with no spaces between identifiers. I have the opening of the output file, and everything goes to the file, but with spaces on either side of the lines. Below I started:

Print #1, "!TRNS", vbTab, "TRNSID", vbTab, "TRNSTYPE", vbTab, "DATE" 'etc...

and I changed it to:

Print #1, "!TRNS", vbTab, Trim(strTRNSID), vbTab, Trim("TRNSTYPE"), vbTab, "DATE" 'etc...

Spaces are not deleted in the output file with the trim function; therefore, I mean that lines that are sent with tabs still have spaces on either side of the lines.

How do I get rid of these gaps?

+3
source share
1 answer

How to bind strings before passing them to the Print command?

Print #1, "!TRNS" & vbTab & Trim(strTRNSID) & vbTab & Trim("TRNSTYPE") & vbTab & "DATE"

, , . ,

+3

All Articles