home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frm8_2_3
- BorderStyle = 3 'Fixed Dialog
- Caption = "8-2-3"
- ClientHeight = 3990
- ClientLeft = 1035
- ClientTop = 1905
- ClientWidth = 4935
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 3990
- ScaleWidth = 4935
- ShowInTaskbar = 0 'False
- Begin VB.PictureBox picReport
- Height = 3255
- Left = 120
- ScaleHeight = 3195
- ScaleWidth = 4635
- TabIndex = 1
- Top = 600
- Width = 4695
- End
- Begin VB.CommandButton cmdCreateReport
- Caption = "Create Report"
- Height = 375
- Left = 1440
- TabIndex = 0
- Top = 120
- Width = 2055
- End
- Attribute VB_Name = "frm8_2_3"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdCreateReport_Click()
- Dim currentMonth As String, newMonth As String
- Dim dayNum As Integer, address As String
- Dim price As Single, monthTotal As Single
- Dim yearTotal As Single, doneFlag As Boolean
- 'Display home sales by month
- picReport.Cls
- Open App.Path & "\HOMESALE.TXT" For Input As #1
- currentMonth = "" 'Name of month being subtotaled
- monthTotal = 0
- yearTotal = 0
- doneFlag = False 'Flag to indicate end of list
- Do While Not doneFlag
- If Not EOF(1) Then
- Input #1, newMonth, dayNum, address, price
- Else
- doneFlag = True 'End of list
- End If
- If (newMonth <> currentMonth) Or (doneFlag) Then 'Control break processing
- If currentMonth <> "" Then 'Don't print subtotal before 1st month
- picReport.Print
- picReport.Print Tab(15); "Subtotal for "; currentMonth; ":";
- picReport.Print Tab(38); FormatCurrency(monthTotal)
- picReport.Print
- End If
- currentMonth = newMonth
- monthTotal = 0
- End If
- If Not doneFlag Then
- picReport.Print newMonth;
- picReport.Print Tab(11); FormatNumber(dayNum, 0);
- picReport.Print Tab(18); address;
- picReport.Print Tab(38); FormatCurrency(price)
- yearTotal = yearTotal + price
- End If
- monthTotal = monthTotal + price
- Loop
- Close #1
- picReport.Print "Total for First Quarter: "; FormatCurrency(yearTotal)
- End Sub
-