Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing sequential files

Status
Not open for further replies.

Waynest

Programmer
Jun 22, 2000
321
GB
Hi

I have an app which builds sequential files containing printer instructions for producing barcodes. Currently I read from these files and write to another (line by line) which is opened as a printer. This seems to cause occasional glitches when the barcodes are printed. Is there a command I can use to print the entire file all at once instead of processsing it line by line?
 
I am tek-tips Barcode guru
I have run into a situation that my help you.
I'm not sure if this will help you.

I open the ASCII text file and leave it open, then when I close it the printer sees it only then not before.

here is my code:

' BarcodeLabelHeader
' An Error occurs and sometimes the file is left open
' so close it first
Close #1

' Delete the file before writing it out
If FileExist("X:\Sales\Serialabel.cmd") Then
Kill "X:\Sales\Serialabel.cmd"
End If

Open "X:\Sales\Shelflabel.cmd" For Output As #1
Print #1, "LABELNAME=X:\Sales\Shelf_2.lbl"
Print #1, "PRINTER=" & Chr$(34) & "SATO CL-608 on \\Smallbserver\SATO CL608" & Chr$(34)
'Print #1, "LABELQUANTITY=1" ' not needed because there is only one label for each anyway
Print #1, "DataType=DELIMITED"
Print #1, "DELIMITER=|"
' Here are the FIVE fields needed for the label
Print #1, "Field=STOCKBAR"
Print #1, "Field=STOCKCODE"
Print #1, "Field=DESCRIPT"
Print #1, "Field=LONG_DESC"
Print #1, "Field=VEND"

Print #1, "LABELDATA=THISFILE"

' this part is the data
Dim db As Database, rst As Recordset, SQL As String
Set db = CurrentDb
' SQL string.
SQL = "SELECT STOCK_CODE, DESCRIPTION, LONG_DESC, ALTERNATE_KEY_1 FROM none_IN_MASTER WHERE STOCK_CODE = '" & Me!Text8 & "';"
Set rst = db.OpenRecordset(SQL)

' Write data to file
Print #1, rst.Fields("STOCK_CODE") & "|" & rst.Fields("STOCK_CODE") & "|" & rst.Fields("DESCRIPTION") & "|" & rst.Fields("LONG_DESC") & "|" & "VEND# " & rst.Fields("ALTERNATE_KEY_1")

Close #1
rst.Close
db.Close DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
PS here is a link to the barcode forum on tek-tips I monitor it regualarly

forum694
DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top