Hi Everyone,
I have a module that prints to a file, but I need it to append spaces at the end of the Supplier Id Field so that it is always 6 characters.
Can someone please help!
Dim SSellInRecordType As String
Dim SSellInSupplierID As String
Dim SSellInTxnDate As String
Open SName For Output As #1 ' Open file for output.
Set Sdb1 = CurrentDb
Set Srecset1 = Sdb1.OpenRecordset("PURCHASES DAILY ALL") 'Open query that hasthe data
With Srecset1
Do Until .EOF 'do until end of file
SSellInRecordType = ![Record Type]
SSellInSupplierID = Format$(![Supplier ID], "######")
SSellInTxnDate = Format$(![Txn Date], "yyyymmdd")
Open SName For Append As #1 'will create a text file called
'exportdata on first loop
'and open the text file
'exportdata on subsequent loops
Print #1, SSellInRecordType & SSellInSupplierID & SSellInTxnDate
Close #1 'close the text file
I have a module that prints to a file, but I need it to append spaces at the end of the Supplier Id Field so that it is always 6 characters.
Can someone please help!
Dim SSellInRecordType As String
Dim SSellInSupplierID As String
Dim SSellInTxnDate As String
Open SName For Output As #1 ' Open file for output.
Set Sdb1 = CurrentDb
Set Srecset1 = Sdb1.OpenRecordset("PURCHASES DAILY ALL") 'Open query that hasthe data
With Srecset1
Do Until .EOF 'do until end of file
SSellInRecordType = ![Record Type]
SSellInSupplierID = Format$(![Supplier ID], "######")
SSellInTxnDate = Format$(![Txn Date], "yyyymmdd")
Open SName For Append As #1 'will create a text file called
'exportdata on first loop
'and open the text file
'exportdata on subsequent loops
Print #1, SSellInRecordType & SSellInSupplierID & SSellInTxnDate
Close #1 'close the text file