[AccessD] Formating Text in a .txt document?

Robert robert at servicexp.com
Fri Apr 16 10:13:09 CDT 2010


Thanks Stuart, worked perfectly...

WBR
Robert



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: Tuesday, April 13, 2010 6:15 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Formating Text in a .txt document?

Yes and no. :-(

YES:
Use a mixture of  Mid$(), Format$() etc  to put the fields  into a string to
lay out the row.

Something like:

strHeader = "Qty    ItemID       Item Descr
Cost"
Print #ff, stHheader

While not rs.EOF
  strRow = Space$(80)
  Mid$(strRow,1,4) = format$(rs!qty,"###0")
  Mid$(strRow,8,12) = rs!(ItemID)
  Mid$(strRow, 21,48) = rs!(ItemDesc)
  Mid$(strRow,70,10) = format$(rs!,Cost,""###,##0.00")
  Print #ff, strRow
  rs.Movenext
Wend
NO:
The rows won't line up unless the recipient is viewing the data in a fixed
width font.

-- 
Stuart


On 13 Apr 2010 at 16:19, Robert wrote:

> Is there any way to created a formatted look for a order detail block in a
> .txt document?
> 
> 
> Example:
> 
>  Qty		Item ID		Item Desc.		Cost
> 
>  1		FR58465		The first 		$125.00
>  1		DSEEFS58465		The Second Time	  $5.00
> 
> Ect...
> 
> 
> WBR
> Robert
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list