⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frm_accountbook.frm

📁 进销存管理系统(VB60+SQL2000)本系统的数据库为SQL Server 2000
💻 FRM
📖 第 1 页 / 共 4 页
字号:
                      If MS1.TextMatrix(m, 3) = "" Then Exit For
                  Next m
                  For h = m - 1 To Adodc5.Recordset.RecordCount + m - 1
                       MS1.TextMatrix(h, 3) = "进货退货:【" & Adodc5.Recordset.Fields("fullname") & "】" & Adodc5.Recordset.Fields("qty") & " * " & Adodc5.Recordset.Fields("price")
                       MS1.TextMatrix(h, 3) = MS1.TextMatrix(h, 3) & " :" & Adodc4.Recordset.Fields("handle")
                      Adodc5.Recordset.MoveNext
                      Adodc4.Recordset.MoveNext
                      If Adodc5.Recordset.EOF Then Exit For
                  Next h
               End If
               
               ''''''''''''''''''''''''''''''''''''''''''''''''''''''
            End If
         ElseIf BCsource = Mid(billcode, 1, 2) Then                    '为进货
            'ADO控件的RecordSource执行SQL语句
            Adodc1.RecordSource = "select * from tbS_warehouse_detailed where (billcode='" + BC + "')ORDER BY tsum"
            Adodc1.Refresh
            Adodc3.RecordSource = "select * from tbS_warehouse_main where billcode='" + BC + "'"
            Adodc3.Refresh
            MS1.Rows = Adodc1.Recordset.RecordCount
            MS1.Rows = MS1.Rows + Adodc1.Recordset.RecordCount      '创建MSFlexGrid表格行数
            If Adodc1.Recordset.RecordCount > 0 Then
               For d = ms To ms + Adodc1.Recordset.RecordCount     '将进货的往来对账 条目 添加到 MSFlexGrid控件中
                   MS1.TextMatrix(d, 1) = Adodc1.Recordset.Fields("billdate")
                   MS1.TextMatrix(d, 2) = Adodc1.Recordset.Fields(0)
                   On Error Resume Next
                   MS1.TextMatrix(d, 3) = "进货:【" & Adodc1.Recordset.Fields("fullname") & "】" & Adodc1.Recordset.Fields("qty") & " * " & Adodc1.Recordset.Fields("price") & " :" & Adodc3.Recordset.Fields("handle")
                   MS1.TextMatrix(d, 6) = Adodc1.Recordset.Fields("tsum")
                   On Error Resume Next
                   MS1.TextMatrix(d, 7) = Adodc3.Recordset.Fields("payment")
                   Adodc1.Recordset.MoveNext
                   Adodc3.Recordset.MoveNext
                   If Adodc1.Recordset.EOF Then Exit For
               Next d
               '''''''''''''''''''''''''''''''''''''''''''''''''''当在您出现你的文本行内,出现空白时,请记住,问题出在“SQL语句排序”
                Adodc3.Recordset.MoveFirst
                Adodc5.RecordSource = "select * from tbS_warehouse_detailed where (billcode='" + BC + "')ORDER BY tsum"
                Adodc5.Refresh
               If Adodc5.Recordset.RecordCount > 0 Then
                  For m = 1 To 99
                      If MS1.TextMatrix(m, 3) = "" Then Exit For
                  Next m
                  For h = m - 1 To Adodc5.Recordset.RecordCount + m - 1
                       MS1.TextMatrix(h, 3) = "进货:【" & Adodc5.Recordset.Fields("fullname") & "】" & Adodc5.Recordset.Fields("qty") & " * " & Adodc5.Recordset.Fields("price")
                       MS1.TextMatrix(h, 3) = MS1.TextMatrix(h, 3) & " :" & Adodc3.Recordset.Fields("handle")
                      Adodc5.Recordset.MoveNext
                      Adodc3.Recordset.MoveNext
                      If Adodc5.Recordset.EOF Then Exit For
                  Next h
               End If
               
               ''''''''''''''''''''''''''''''''''''''''''''''''''''''
            End If
         End If
         '//////////////////////////////////////////////////////////////////////////////////////
         
         If billcode = "XSTH" Then      '为销售退货
           'ADO控件的RecordSource执行SQL语句
            Adodc2.RecordSource = " select * from tbS_resell_detailed where (billcode='" + BC + "')ORDER BY tsum"
            Adodc2.Refresh
            Adodc4.RecordSource = " select * from tbS_resell_main where billcode='" + BC + "'"
            Adodc4.Refresh
            MS1.Rows = MS1.Rows + Adodc2.Recordset.RecordCount        '创建MSFlexGrid表格行数
            If Adodc2.Recordset.RecordCount > 0 Then
               For j = ms To ms + Adodc2.Recordset.RecordCount  '将销售退货的往来对账 条目 添加到 MSFlexGrid控件中
                   MS1.TextMatrix(j, 1) = Adodc2.Recordset.Fields("billdate")
                   MS1.TextMatrix(j, 2) = Adodc2.Recordset.Fields(0)
                   On Error Resume Next
                   MS1.TextMatrix(j, 3) = "销售退货:【" & Adodc2.Recordset.Fields("fullname") & "】" & Adodc2.Recordset.Fields("qty") & " * " & Adodc2.Recordset.Fields("price") & " :" & Adodc4.Recordset.Fields("handle")
                   MS1.TextMatrix(j, 6) = Adodc2.Recordset.Fields("tsum")
                   MS1.TextMatrix(j, 7) = Adodc4.Recordset.Fields("payment")
                   Adodc2.Recordset.MoveNext
                   Adodc4.Recordset.MoveNext
                   If Adodc2.Recordset.EOF Then Exit For  '记录到了结尾,结束For循环
               Next j
               
               '''''''''''''''''''''''''''''''''''''''''''''''''''当在您出现你的文本行内,出现空白时,请记住,问题出在“SQL语句排序”
                Adodc4.Recordset.MoveFirst  '将记录移动到下一条
                  'ADO控件的RecordSource执行SQL语句
                Adodc5.RecordSource = "select * from tbS_resell_detailed where (billcode='" + BC + "')ORDER BY tsum"
                Adodc5.Refresh
               If Adodc5.Recordset.RecordCount > 0 Then
                  For m = 1 To 99
                      If MS1.TextMatrix(m, 3) = "" Then Exit For
                  Next m
                  For h = m - 1 To Adodc5.Recordset.RecordCount + m - 1
                       MS1.TextMatrix(h, 3) = "销售退货:【" & Adodc5.Recordset.Fields("fullname") & "】" & Adodc5.Recordset.Fields("qty") & " * " & Adodc5.Recordset.Fields("price")
                       MS1.TextMatrix(h, 3) = MS1.TextMatrix(h, 3) & " :" & Adodc4.Recordset.Fields("handle")
                      Adodc5.Recordset.MoveNext
                      Adodc4.Recordset.MoveNext
                      If Adodc5.Recordset.EOF Then Exit For
                  Next h
               End If
               
               ''''''''''''''''''''''''''''''''''''''''''''''''''''''
            End If
         ElseIf SCsource = Mid(billcode, 1, 2) Then                             '为销售
           'ADO控件的RecordSource执行SQL语句
            Adodc1.RecordSource = "select * from tbS_sell_detailed where (billcode='" + BC + "')ORDER BY tsum"
            Adodc1.Refresh
            Adodc3.RecordSource = "select * from tbS_sell_main where billcode='" + BC + "'"
            Adodc3.Refresh
            MS1.Rows = MS1.Rows + Adodc1.Recordset.RecordCount        '创建MSFlexGrid表格行数
            If Adodc1.Recordset.RecordCount > 0 Then
               For d = ms To ms + Adodc1.Recordset.RecordCount    '将销售 的往来对账 条目 添加到 MSFlexGrid控件中
                   MS1.TextMatrix(d, 1) = Adodc1.Recordset.Fields("billdate")
                   MS1.TextMatrix(d, 2) = Adodc1.Recordset.Fields(0)
                   On Error Resume Next
                   MS1.TextMatrix(d, 3) = "销售:【" & Adodc1.Recordset.Fields("fullname") & "】" & Adodc1.Recordset.Fields("qty") & " * " & Adodc1.Recordset.Fields("price") & " :" & Adodc3.Recordset.Fields("handle")
                   MS1.TextMatrix(d, 4) = Adodc1.Recordset.Fields("tsum")
                   On Error Resume Next
                   MS1.TextMatrix(d, 5) = Adodc3.Recordset.Fields("gathering")
                   Adodc1.Recordset.MoveNext
                   Adodc3.Recordset.MoveNext
                   If Adodc1.Recordset.EOF Then Exit For
               Next d
               
               '''''''''''''''''''''''''''''''''''''''''''''''''''当在您出现你的文本行内,出现空白时,请记住,问题出在“SQL语句排序”
                Adodc3.Recordset.MoveFirst          '移动下一条
                  'ADO控件的RecordSource执行SQL语句
                Adodc5.RecordSource = "select * from tbS_sell_detailed where (billcode='" + BC + "')ORDER BY tsum"
                Adodc5.Refresh
               If Adodc5.Recordset.RecordCount > 0 Then
                  For m = 1 To 99
                      If MS1.TextMatrix(m, 3) = "" Then Exit For
                  Next m
                  For h = m - 1 To Adodc5.Recordset.RecordCount + m - 1
                       MS1.TextMatrix(h, 3) = "销售:【" & Adodc5.Recordset.Fields("fullname") & "】" & Adodc5.Recordset.Fields("qty") & " * " & Adodc5.Recordset.Fields("price")
                       MS1.TextMatrix(h, 3) = MS1.TextMatrix(h, 3) & " :" & Adodc3.Recordset.Fields("handle")
                      Adodc5.Recordset.MoveNext
                      Adodc3.Recordset.MoveNext
                      If Adodc5.Recordset.EOF Then Exit For '记录到末尾时,跳出For循环
                  Next h
               End If
               ''''''''''''''''''''''''''''''''''''''''''''''''''''''
            End If
         End If
        adoAccount.Recordset.MoveNext
         If adoAccount.Recordset.EOF Then Exit For   '记录到末尾时,跳出For循环
     Next i
  Else
    MsgBox "没有你要分析的往来对账!"
  End If

  adoAccount.RecordSource = "SELECT * FROM (SELECT units, SUM(addgathering) AS 应收增加, SUM(factaddfee) AS 实际增加,SUM(reducegathering) AS 应收减少, SUM(factfee) AS 实际减少 FROM (SELECT * FROM tbS_currentaccount WHERE (billdate BETWEEN '" & frm_addDate.DTPicker1.Value & "'AND '" & frm_addDate.DTPicker2.Value & "')) DERIVEDTBL GROUP BY units) DERIVEDTBL WHERE (units = '" + frm_unitsList.adoCount.Recordset.Fields(0).Value + "')"
  adoAccount.Refresh
  LabPayment.Caption = " " & Format(adoAccount.Recordset.Fields(3) - adoAccount.Recordset.Fields(4), "#0.00") & "  元"
  LabGathering.Caption = " " & Format(adoAccount.Recordset.Fields(1) - adoAccount.Recordset.Fields(2), "#0.00") & "  元"

  SBar1.Panels(2) = "应收增加: " & Format(adoAccount.Recordset.Fields(1), "#0.00") & "  元"
  SBar1.Panels(3) = "实际增加: " & Format(adoAccount.Recordset.Fields(2), "#0.00") & "  元"
  SBar1.Panels(4) = "应收减少: " & Format(adoAccount.Recordset.Fields(3), "#0.00") & "  元"
  SBar1.Panels(5) = "实际减少: " & Format(adoAccount.Recordset.Fields(4), "#0.00") & "  元"
    '定义MS1表的列序号
  For i = 1 To MS1.Rows - 2
      MS1.TextMatrix(i, 0) = i
  Next i
  MS1.Rows = MS1.Rows - 1
End Sub

Sub MSF1()   '自定义过程MSF1()-----初始化MSFleshGrid控件
  MS1.Cols = 8  '定义MS1控件的总列数。
  '定义MS1表的宽度
  MS1.ColWidth(0) = 12 * 25 * 2
  MS1.ColAlignment(0) = 4
  MS1.ColWidth(1) = 12 * 25 * 4
  MS1.ColWidth(2) = 12 * 25 * 6
  MS1.ColWidth(3) = 12 * 25 * 12
  MS1.ColWidth(4) = 12 * 25 * 3
  MS1.ColWidth(5) = 12 * 25 * 3
  MS1.ColWidth(6) = 12 * 25 * 3
  MS1.ColWidth(7) = 12 * 25 * 3
  '设置固定行、列
  MS1.FixedRows = 1: MS1.FixedCols = 1
  '定义MS1表的表头
  MS1.TextMatrix(0, 0) = "NO。"
  MS1.TextMatrix(0, 1) = "日期"
  MS1.TextMatrix(0, 2) = "单据编号"
  MS1.TextMatrix(0, 3) = "摘要"
  MS1.TextMatrix(0, 4) = "应收增加"
  MS1.TextMatrix(0, 5) = "实际增加"
  MS1.TextMatrix(0, 6) = "应收减少"
  MS1.TextMatrix(0, 7) = "实际减少"

End Sub

Private Sub Form_Unload(Cancel As Integer)
  If frm_unitsList.u = 1 Then frm_unitsList.u = 2222
  Unload Me
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
  Select Case Button.Key
         Case Is = "prt"
              Call prt
         Case Is = "Exit"
              If frm_unitsList.u = 1 Then frm_unitsList.u = 2222
              Unload Me
  End Select
End Sub

Sub conAdo()
  Adodc1.ConnectionString = PublicStr
  Adodc1.RecordSource = "select * from tbS_warehouse_detailed"
  Adodc1.Refresh
  Adodc2.ConnectionString = PublicStr
  Adodc2.RecordSource = "select * from tbS_rewarehouse_detailed"
  Adodc2.Refresh
  Adodc3.ConnectionString = PublicStr
  Adodc3.RecordSource = "select * from tbS_warehouse_main"
  Adodc3.Refresh
  Adodc4.ConnectionString = PublicStr
  Adodc4.RecordSource = "select * from tbS_rewarehouse_main"
  Adodc4.Refresh
  Adodc5.ConnectionString = PublicStr
  adoAccount.ConnectionString = PublicStr
  adoAccount.RecordSource = "select * from tbS_currentaccount"
  adoAccount.Refresh
End Sub
Sub prt()
  Dim i As Integer
  Dim v1 As Integer
  Dim v2 As Integer
  Dim v3 As Integer
  Dim v4 As Integer
  Dim v5 As Integer
  Dim v6 As Integer
  Dim v7 As Integer
  Dim v8 As Integer
  Dim v9 As Integer
  Dim X As Double
   v1 = 100
   X = 1.1
   v2 = MS1.ColWidth(0) * X + v1
   v3 = v2 + MS1.ColWidth(1) * X
   v4 = v3 + MS1.ColWidth(2) * X
   v5 = v4 + MS1.ColWidth(3) * X
   v6 = v5 + MS1.ColWidth(4) * X
   v7 = v6 + MS1.ColWidth(5) * X
   v8 = v7 + MS1.ColWidth(6) * X
   v9 = v8 + MS1.ColWidth(7) * X
  Dim myval15 As Single
      myval15 = 1
  Dim A As Integer
  Dim d As Integer
  Dim e As Integer
  Dim F As Integer
     If MS1.Rows > 0 Then
        If MS1.Rows < 60 Then
           Printer.FontSize = 12
           Printer.CurrentX = 2600
           Printer.CurrentY = 200
           Printer.Print "与『" & Label4.Caption & "』" & Me.Caption       '标题
           Printer.CurrentX = 200
           Printer.CurrentY = 700
           Printer.FontSize = 11
           Printer.Print "日期:" & Date
           Printer.CurrentX = 3000
           Printer.CurrentY = 700
           Printer.Print "时间:" & Time
           Dim c As Integer
           A = 1100
           c = 1
      For i = 0 To MS1.Rows - 1
          Printer.FontSize = 8
          v9 = MS1.Width
          v11 = v9
          Printer.Line (v1, A)-(v9, A)
          If MS1.ColWidth(0) > 0 Then
             Printer.Line (v1, A)-(v1, A + 300)
             Printer.CurrentX = 260
             Printer.CurrentY = A + 50
'             Printer.FontSize = 10
             If MS1.TextMatrix(i, 0) <> "" Then Printer.Print MS1.TextMatrix(i, 0)
          End If
          If MS1.ColWidth(1) > 0 Then
              Printer.Line (v2, A)-(v2, A + 300)
              Printer.CurrentX = v2 '+ 10
              Printer.CurrentY = A + 50
'              Printer.FontSize = 11
              If MS1.TextMatrix(i, 1) <> "" Then Printer.Print MS1.TextMatrix(i, 1)
           End If
           If MS1.ColWidth(2) > 0 Then
               Printer.Line (v3, A)-(v3, A + 300)
               Printer.CurrentX = v3 '+ 50
               Printer.CurrentY = A + 50
'               Printer.FontSize = 11
               If MS1.TextMatrix(i, 2) <> "" Then Printer.Print MS1.TextMatrix(i, 2)
           End If
           If MS1.ColWidth(3) > 0 Then
               Printer.Line (v4, A)-(v4, A + 300)
               Printer.CurrentX = v4 + 50
               Printer.CurrentY = A + 50
'               Printer.FontSize = 11
               If MS1.TextMatrix(i, 3) <> "" Then Printer.Print MS1.TextMatrix(i, 3)
            End If
            If MS1.ColWidth(4) > 0 Then

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -