i have 2 textboxs the first one is captioned FROM: the second is captioned
TO: i want to enter values into these textboxs. and print out the results
such as FROM: 100 TO: 135 and then have the results print out four per
sheet of paper such as result 100-104, 105-109, 110-114, 115-119, 120-124,
125-129, 130-134, 135 on a seperate sheet of paper. here is the code i am
working with. right now it will print pages as such: first page will be ok
it will print 100-104, the second page will print a page with only a line
down the right the third and following pages will print as such 105 and
then a linedown the rest of the page, 106 and then a linedown the rest of
the page, so forth up to page 133 and the no line down the right. here is
my code.
Dim a As Integer
Dim X As Integer
Dim Y As Integer
Dim nIndex
Dim tickets
Dim pages
Dim z
Dim O
Dim kSingles
Dim nLong As String
Dim mLong As String
'SQL statements to access the
'database.
z = txtValue
O = Text2
If z = "" Then
MsgBox "ENTER a value in the textbox.", vbExclamation + vbOKOnly, "Please
try agian"
GoTo annuleren
ElseIf z < 1 Or z > 1000 Then
MsgBox "ENTER a value in the textbox.", vbExclamation + vbOKOnly, "Please
try agian"
GoTo annuleren
ElseIf O < 1 Or O > 1000 Then
MsgBox "ENTER a value in the textbox.", vbExclamation + vbOKOnly, "Please
try agian"
GoTo annuleren
End If
Select Case z
Case 1 To 4000
If txtTickets = txtTickets Then
tickets = txtTickets
pages = tickets / 4
End If
End Select
'Activates the single page printing.
a = 200
For kSingles = z To O
For nIndex = kSingles To tickets Step pages
Printer.Print
Printer.PaintPicture picAddress, 7600, a + 500, 4000, 2500
Y = Printer.CurrentY
Printer.Line (7222, 15500)-(7222, 25)
Printer.Line (7223, 15500)-(7223, 25)
Printer.CurrentX = Y
Printer.ForeColor = QBColor(15)
Printer.Print Format$(nIndex, "0000"
Data1.RecordSource = number1 'Charity
Data1.Refresh
Printer.CurrentX = 300
Printer.CurrentY = a
Printer.ForeColor = QBColor(0)
Printer.Font.Size = 11
Printer.Print ""
Printer.Font.Name = "arial"
Printer.Font.Size = 17
Printer.CurrentX = (6900 \ 1 - Printer.TextWidth(txtText)) \ 2
Printer.Print txtText
Printer.Font.Size = 5
Printer.Print ""
Printer.Font.Size = 10
Printer.Print Tab(35); "presents"
Printer.Font.Size = 5
Printer.Print ""
Printer.Font.Size = 13
Data1.RecordSource = number1 'ShortDescription
Data1.Refresh
Printer.CurrentX = (6900 \ 1 - Printer.TextWidth(txtText1)) \ 2
Printer.Print txtText1
Printer.Font.Size = 8
Data1.RecordSource = number1 'LongDescription
Data1.Refresh
nLong = Mid(txtText2, 1, 95)
mLong = Mid(txtText2, 96)
Printer.Print Tab(6); nLong
Printer.Print Tab(6); mLong
Printer.Font.Size = 5
Printer.Print ""
Printer.Font.Size = 12
Data1.RecordSource = Prize 'PrizeName line.
Data1.Refresh
Printer.Print Tab(14); "1st Prize:"; Tab(25); txtText3
Printer.Font.Size = 5
Printer.Print ""
Printer.Font.Size = 12
Data1.RecordSource = Prize 'MarketValue line.
Data1.Refresh
Printer.Print Tab(6); "Value:"; Tab(14); Format$(txtText6, "$##,###.00"
Data1.RecordSource = number1
Data1.Refresh
Printer.Print Tab(39); "Drawing:"; Tab(49); txtText4
Printer.Font.Size = 5
Printer.Print ""
Printer.Font.Size = 12
Data1.RecordSource = number1 'TimePlace
Data1.Refresh
Printer.CurrentX = (6900 \ 1 - Printer.TextWidth(txtText5)) \ 2
Printer.Print txtText5
Printer.Font.Size = 5
Printer.Print ""
Printer.Font.Size = 10
Printer.Print Tab(3); Format$(txtTool, "$##,###.00" ; Tab(62);
Format$(nIndex, "0000" & " of " & Format$(tickets, "0000" Tab(85);
Format$(txtTool, "$##,###.00" Tab(120); Format$(nIndex, "0000"
Printer.Print
a = a + 3800
Next nIndex
Next kSingles
Printer.NewPage
End
End
annuleren:
Form1.Show
thank you
stephen mentzer
compcad@aol.com
TO: i want to enter values into these textboxs. and print out the results
such as FROM: 100 TO: 135 and then have the results print out four per
sheet of paper such as result 100-104, 105-109, 110-114, 115-119, 120-124,
125-129, 130-134, 135 on a seperate sheet of paper. here is the code i am
working with. right now it will print pages as such: first page will be ok
it will print 100-104, the second page will print a page with only a line
down the right the third and following pages will print as such 105 and
then a linedown the rest of the page, 106 and then a linedown the rest of
the page, so forth up to page 133 and the no line down the right. here is
my code.
Dim a As Integer
Dim X As Integer
Dim Y As Integer
Dim nIndex
Dim tickets
Dim pages
Dim z
Dim O
Dim kSingles
Dim nLong As String
Dim mLong As String
'SQL statements to access the
'database.
z = txtValue
O = Text2
If z = "" Then
MsgBox "ENTER a value in the textbox.", vbExclamation + vbOKOnly, "Please
try agian"
GoTo annuleren
ElseIf z < 1 Or z > 1000 Then
MsgBox "ENTER a value in the textbox.", vbExclamation + vbOKOnly, "Please
try agian"
GoTo annuleren
ElseIf O < 1 Or O > 1000 Then
MsgBox "ENTER a value in the textbox.", vbExclamation + vbOKOnly, "Please
try agian"
GoTo annuleren
End If
Select Case z
Case 1 To 4000
If txtTickets = txtTickets Then
tickets = txtTickets
pages = tickets / 4
End If
End Select
'Activates the single page printing.
a = 200
For kSingles = z To O
For nIndex = kSingles To tickets Step pages
Printer.Print
Printer.PaintPicture picAddress, 7600, a + 500, 4000, 2500
Y = Printer.CurrentY
Printer.Line (7222, 15500)-(7222, 25)
Printer.Line (7223, 15500)-(7223, 25)
Printer.CurrentX = Y
Printer.ForeColor = QBColor(15)
Printer.Print Format$(nIndex, "0000"
Data1.RecordSource = number1 'Charity
Data1.Refresh
Printer.CurrentX = 300
Printer.CurrentY = a
Printer.ForeColor = QBColor(0)
Printer.Font.Size = 11
Printer.Print ""
Printer.Font.Name = "arial"
Printer.Font.Size = 17
Printer.CurrentX = (6900 \ 1 - Printer.TextWidth(txtText)) \ 2
Printer.Print txtText
Printer.Font.Size = 5
Printer.Print ""
Printer.Font.Size = 10
Printer.Print Tab(35); "presents"
Printer.Font.Size = 5
Printer.Print ""
Printer.Font.Size = 13
Data1.RecordSource = number1 'ShortDescription
Data1.Refresh
Printer.CurrentX = (6900 \ 1 - Printer.TextWidth(txtText1)) \ 2
Printer.Print txtText1
Printer.Font.Size = 8
Data1.RecordSource = number1 'LongDescription
Data1.Refresh
nLong = Mid(txtText2, 1, 95)
mLong = Mid(txtText2, 96)
Printer.Print Tab(6); nLong
Printer.Print Tab(6); mLong
Printer.Font.Size = 5
Printer.Print ""
Printer.Font.Size = 12
Data1.RecordSource = Prize 'PrizeName line.
Data1.Refresh
Printer.Print Tab(14); "1st Prize:"; Tab(25); txtText3
Printer.Font.Size = 5
Printer.Print ""
Printer.Font.Size = 12
Data1.RecordSource = Prize 'MarketValue line.
Data1.Refresh
Printer.Print Tab(6); "Value:"; Tab(14); Format$(txtText6, "$##,###.00"
Data1.RecordSource = number1
Data1.Refresh
Printer.Print Tab(39); "Drawing:"; Tab(49); txtText4
Printer.Font.Size = 5
Printer.Print ""
Printer.Font.Size = 12
Data1.RecordSource = number1 'TimePlace
Data1.Refresh
Printer.CurrentX = (6900 \ 1 - Printer.TextWidth(txtText5)) \ 2
Printer.Print txtText5
Printer.Font.Size = 5
Printer.Print ""
Printer.Font.Size = 10
Printer.Print Tab(3); Format$(txtTool, "$##,###.00" ; Tab(62);
Format$(nIndex, "0000" & " of " & Format$(tickets, "0000" Tab(85);
Format$(txtTool, "$##,###.00" Tab(120); Format$(nIndex, "0000"
Printer.Print
a = a + 3800
Next nIndex
Next kSingles
Printer.NewPage
End
End
annuleren:
Form1.Show
thank you
stephen mentzer
compcad@aol.com