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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tractor Fed Part II - How to Define My Own Paper Size?

Status
Not open for further replies.

Pampas58

Technical User
May 27, 2004
24
US
Well, I'm trying another approach to this question. I found where I could define the Printer.TopMargin = 0 but the form feed, or perforation skip (which are both set to NO on the printer - a 24 pin Dot Matrix Impact printer) continues to happen; which points to my Access 2002 report.

So, I defined a new page size in the Windows XP, Printers and Faxes, File, Server Properties to be 22.74 inches long (the maximum page length Access will support). The problem is it won't show up on the Page Set Up of the Access Report I wrote.

I looked and found Printer.PaperSize = acPRPSUser but don't know how to specify my "LONG FORM" page size.

Can Anyone help me specify my USER DEFINED Paper Size?

Many Thanks in advance...

Pampas58
 
Have you started from scratch, using the label wizard, and using stock that you pre-select from the wizard? It sounds like you are confusing paper dimensions in design view with settings from the wizard...

"Business conventions are important because they demonstrate how many people a company can operate without."
 
genomon,

Yes, twice just to make sure I had it right. I get a 3.375 automatic advance at the end of what would be a 8-1/2 x 11 letter size page. When I try to change from letter to legal, then the skip takes place at the end of the legal size page.

So I go looking for a longer page, and the 3.375 inch automatic advance is still there. I set the printer.tommargin = 0 and printer.bottommargin = 0 and it still skips 3.375.

Then I tried to create a 22.74 inch long form, and it worked but now I can't get it from the prototype program to the production program. Then I found this "User Defined" paper size and I'm trying to figure out how to programatically force the report to use the 22.74 inch length paper. While that's not enough for a long run on a tractor feed label, it's a lot better than printing 6 lables and resetting the printer.

I've been in touch with Okidata and they tell me that it's an Access issue; but many of the forums I read keep pointing to the print driver.

 
I get a 3.375 automatic advance at the end of what would be a 8-1/2 x 11 letter size page. When I try to change from letter to legal, then the skip takes place at the end of the legal size page.

No "letter sized page". This is a roll of labels. Make the detail section exactly as big as the label...

"Business conventions are important because they demonstrate how many people a company can operate without."
 
genomon,

Great suggestion and I tried it. I get a 3.375 feed after each label rather than after the full page. So I end up with 6 lables with 6 pieces with 6 3.375 feeds in between.

ahhh, the joy of programming, no?!?
 
Arrrrrrr laddie! Works fine on both my rigs (ACC2K & 2K7).
Sorry can't be of more help! Good luck - sometimes taking a break with a cold beer helps it go away.....

[cheers]

"Business conventions are important because they demonstrate how many people a company can operate without."
 
genomon;

Just to let you know, I did start from scratch one more time and I still get the feed. This time it was only 1.25 inches which happens to be exactly 2x the Top Margin default for the letter size.

At any rate, I'm trying to feed the following information into the Okidata (based on their reference data online). Supposedly it will point either to Okidata or to Microsoft or to Me. Here goes:

To set the page length in inches in the MICROLINE Standard emulation, use the command ESC G Hn Ln. This sets the page length in increments of ½ x the value of the variables Hn Ln. Variables Hn Ln represent a 2-digit ASCII number ranging from 00 to 99. For lengths of less than 4-1/2, use a zero for Hn. For example, to set a page length of 14 inches, enter the BASIC statement

LPRINT CHR$(27);G;28

I tried to do the following:
Open "LPT1" For Output As #1
Print #1, Chr$(27); G; 28
MsgBox "Sent the code, Hope it works"
Close #1

I get the message box, and I get it printing out on the paper, not what is supposed to happen. So I think I'm just not good enough in VB to translate the old LPRINT command. Can you give it a look and let me know if I have a syntax error, or just I'm off on a wild goose chase?
 
In all of these messages, I seem to have missed where you tell us the Height of your detail section. I would think you could:
- set the Height of your detail section to the height of your label
- set the top and bottom margins to 0
- set the detail section to not allow growing
- create a printer page height to your label and detail section height.

Duane
Hook'D on Access
MS Access MVP
 
dhookom,

Thank you for your response. I’m listing the answers below.

- set the Height of your detail section to the height of your label
[Pampas58] - The height of the detail section is 1.5 inches
- set the top and bottom margins to 0
[Pampas58] - That’s the rub, Access won’t Allow it
- set the detail section to not allow growing
[Pampas58] - That I had not tried, I will and let you know
- create a printer page height to your label and detail section height.
[Pampas58] – I have done that, and it gives me nothing but more feeds at the end of each page

The thing that keeps me thinking it’s an access issue that I just have not figured out how to get around is that I wrote the following module:

Open “LPT1” for output as #1
For n = 1 to 500
Print #1 “This is a test of the perforation skip on the printer” (wording may have been a bit different, but you get the idea)
Next
Close #1


I did that to see if my OKIDATA ML591 had an issue skipping over the defined page perforations, but it never skipped a line, it ignored the page length and kept on typing right over the Green Bar test paper perforations I used. So while I’m not totally dismissing the printer as an issue, or the driver; right now it seems that Access has a built in minimum Top Margin and even when I set the property;

Printer.TopMargin = 0

I still get that skip.

Any and all suggestions will be tried to make sure I get this to work; thank you very much for taking the time to give me some ideas to try.

Pampas58


 
Well, while I have gone to a NUMBER of technical forums trying to get the answer to the Tractor Feed Label Problem, no one seemed to have the answer I was looking for. Many pointed to the OKIDATA ML591, others pointed to Access 2002 and in the end I still don’t have an answer.

However, since I did figure out a “brute force” method I thought I’d add it here and on the other Forums as a way for you to deal with the issues and perhaps you can come up with a more elegant solution and if so I’d truly appreciate it if you’d send me the answers as well.

In essence what you’re going to see is that I create the labels in a loop, and format the serial number (S/N) to our liking. Then I enumerate the labels on the table and from there I simply do a filter that prints one report (first 6 S/N labels) and then closes and prints another report (the next 6 S/N labels) allowing the user to reset the printer’s position.

Since it is starting at the top of the page, there is no need to waste any labels. Any and all suggestions are still not only welcomed, but also desperately sought

Code:
Private Sub cmd_Gen_LabelSet_Click()
On Error GoTo Err_Gen_LabelSet_Click
    Dim sSerialBase As String
    Dim sModelNumber As String
    Dim sSerialNumber As String
    Dim sACvolt As String
    Dim sACamp As String
    Dim sPhase As String
    Dim sCnt As String
    Dim sHertz As String
    Dim sDCVolts As String
    Dim stDocName As String
    Dim stCriteria As String
    Dim iSeqStart As Integer
    Dim iSeqEnd As Integer
    Dim iLabelNumber As Integer
    Dim iTotalLabels As Integer
    Dim iNumberOfPages As Integer
    Dim iPage As Integer
    Dim iFirstLabel As Integer
    Dim iLastLabel As Integer
    
DoCmd.OpenQuery "qryDEL_Old_Gen_Set", acNormal, acEdit
    
'this section opens up the labelgen database to stuff the label
'information into it
    Dim db As DAO.Database
    Dim rst As DAO.Recordset
    
' this section captures the data from the form
    sSerialBase = [Base Serial Number]
    iSeqStart = [Sequence Start]
    iSeqEnd = [Sequence Finish]
    
    Set db = CurrentDb()
    Set rst = db.OpenRecordset("tblLabel_gen", dbOpenDynaset)
'this section starts to generate the serial numbers
    If IsNull([Hetz]) Then [Hetz] = " "
    
    
    With rst

        For cnt = iSeqStart To iSeqEnd ' sets up the serial number sequence
        .AddNew ' opens the table to add new records
' This section Formats the Serial Number so that it has leading zeros
            If cnt <= 9 Then sCnt = "00" & cnt
            If cnt >= 10 And cnt < 100 Then sCnt = "0" & cnt
            If cnt >= 100 Then sCnt = cnt
            
            sSerialNumber = sSerialBase & sCnt ' stores the formated S/N
            iLabelNumber = iLabelNumber + 1 ' Stores Label Count
            
' this section writes the data into the label database
            ![Label Number] = iLabelNumber
            ![Serial Number] = sSerialNumber
            ![Model Number] = [Model Number]
            ![AC Voltage] = [AC Voltage]
            ![AC Amps] = [AC Amps]
            ![Phase] = [Phase]
            ![Hetz] = [Hetz]
            ![DC Volts] = [DC Volts]
            ![Max DC Amps] = [Max DC Amps]
        .Update 'without the Update statement it's not going to get stored
        Next
    
    End With

' capture the number of labels created
    iTotalLabels = iLabelNumber
    
' see how many sets of reports (pages) must be printed
' each LETTER size page, will print 6 labels custom sized for our application
' the 5/6 addition at the end is to round up to the next full page
' 1 label of 6 (1/6) + (5/6) then the integer makes it a full page number

    iNumberOfPages = Int((iTotalLabels / 6) + (5 / 6))

    
'print the pages
    For iPage = 1 To iNumberOfPages
        iLastLabel = iPage * 6  ' Define the last label on the page
        iFirstLabel = iLastLabel - 6    ' subtract 6 to find the first label
        stCriteria = "[Label Number] >" & iFirstLabel & _
            "AND [Label Number] <=" & iLastLabel    ' set the Filter for each pass
        
        
    MsgBox "ALERT!!!:  ALIGN FOR NEXT LABEL SET"    ' Alert the user to reset the label indexing
        stDocName = "Label 1"
    
        'DoCmd.OpenReport stDocName, acPreview
        DoCmd.OpenReport stDocName, acViewNormal, , stCriteria
    Next

MsgBox "COMPLETE! - No More Labels To Print, Thank you and print again soon..."
   
Exit_Gen_LabelSet_Click:
    Exit Sub

Err_Gen_LabelSet_Click:
    MsgBox Err.Description
    Resume Exit_Gen_LabelSet_Click


End Sub

Thanks to genomon and to dhookom from trying to help me out.

Pampas58
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top