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

📄 zhfx.frm

📁 关于图书销售管理
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         Left            =   2760
         TabIndex        =   13
         Top             =   2040
         Width           =   1215
      End
      Begin VB.Label Label4 
         Caption         =   "其他支出"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   240
         TabIndex        =   12
         Top             =   2520
         Width           =   1215
      End
      Begin VB.Label Label2 
         Caption         =   "进货支出"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   360
         TabIndex        =   11
         Top             =   1560
         Width           =   975
      End
   End
End
Attribute VB_Name = "zhfx1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public bc As Integer


Private Sub Command1_Click()
ts = CDate(Text3.Text) - CDate(Text4.Text)
If ts = 0 Then ts = 1
zqse = Val(Label15.Caption) - Val(Label14.Caption)
If zqse < 0 Then
     fxjg.Image1.Visible = False
     fxjg.Image2.Visible = True
     fxjg.Label1.Caption = "太可惜了 " & ts & " 天你亏了" & -(zqse) & "元"
    ElseIf zqse = 0 Then
             fxjg.Image1.Visible = False
              fxjg.Image2.Visible = True
               fxjg.Label1.Caption = "太可惜了 " & ts & " 天你没有赚到钱。"
      ElseIf zqse > 0 Then
              fxjg.Image1.Visible = True
               fxjg.Image2.Visible = False
               fxjg.Label1.Caption = "恭喜你! " & ts & " 天你赚到" & zqse & "元。"
 
End If
   fxjg.Show
     
    
     
End Sub

Private Sub Command10_Click()
kcspcx.Show
End Sub

Private Sub Command2_Click()
bc = 1
On Error Resume Next
Data1.RecordSource = "select * from jhfkd where fkrq <= #" & Format(CDate(Text3.Text), "mmm d yyyy") & "#" & " and fkrq >= #" & Format(CDate(Text4.Text), "mmm d yyyy") & "#"
Data1.Refresh
Data1.Recordset.MoveLast
a = Data1.Recordset.RecordCount
Data1.Recordset.MoveFirst
For i = 1 To a
    jhzc1 = jhzc1 + Data1.Recordset("sfzk")
    Data1.Recordset.MoveNext
 Next
 Data1.Recordset.MoveFirst
 'With Data2
'Data2.RecordSource = "select * from gzffb"
'Data2.RecordSource = "select * from gzffb where ny <= '" & Left(Text3.Text, 5) & "'  and ny >= '" & Left(Text4.Text, 5) & "'"
'Data2.Refresh
'Data2.Recordset.MoveLast
'b = Data2.Recordset.RecordCount
'Data2.Recordset.MoveFirst
'For j = 1 To b
'    gzff1 = gzff1 + Data2.Recordset("se")
'    Data2.Recordset.MoveNext
' Next
' Data2.Recordset.MoveFirst
'End With

Data4.RecordSource = "select * from spzjrk   where rkrq <= #" & Format(CDate(Text3.Text), "mmm d yyyy") & "#" & " and rkrq >= #" & Format(CDate(Text4.Text), "mmm d yyyy") & "#"
Data4.Refresh
Data4.Recordset.MoveLast
c = Data4.Recordset.RecordCount
Data4.Recordset.MoveFirst
For k = 1 To c
    je1 = Data4.Recordset("je") - Data4.Recordset("zk") + je1
    Data4.Recordset.MoveNext
 Next
 Data4.Recordset.MoveFirst
 
Text2.Text = je1 + jhzc1
Data5.RecordSource = "select * from xhskd   where skrq <= #" & Format(CDate(Text3.Text), "mmm d yyyy") & "#" & " and skrq >= #" & Format(CDate(Text4.Text), "mmm d yyyy") & "#"
Data5.Refresh
Data5.Recordset.MoveLast
d = Data5.Recordset.RecordCount
Data5.Recordset.MoveFirst
For h = 1 To d
    sszk1 = Data5.Recordset("sszk") + sszk1
    Data5.Recordset.MoveNext
 Next
 Data5.Recordset.MoveFirst
Data6.RecordSource = "select * from spzjck   where ckrq <= #" & Format(CDate(Text3.Text), "mmm d yyyy") & "#" & " and ckrq >= #" & Format(CDate(Text4.Text), "mmm d yyyy") & "#"
Data6.Refresh
Data6.Recordset.MoveLast
f = Data6.Recordset.RecordCount
Data6.Recordset.MoveFirst
For k = 1 To f
    ssje1 = Data6.Recordset("ssje") + ssje1
    Data6.Recordset.MoveNext
 Next
 Data6.Recordset.MoveFirst
Text6.Text = ssje1 + sszk1
Data3.RecordSource = "select * from spdhd   where  sfrk = 0 and dhrq <= #" & Format(CDate(Text3.Text), "mmm d yyyy") & "#" & " and dhrq >= #" & Format(CDate(Text4.Text), "mmm d yyyy") & "#"
Data3.Refresh
Data3.Recordset.MoveLast
l = Data3.Recordset.RecordCount
Data3.Recordset.MoveFirst
For p = 1 To l
   ljje1 = Data3.Recordset("ljje") - Data3.Recordset("dingjin") + ljje1
    Data3.Recordset.MoveNext
 Next
 Data3.Recordset.MoveFirst
Text14.Text = ljje1
Data7.RecordSource = "select * from xhdd   where  sfck = 0 and fhrq <= #" & Format(CDate(Text3.Text), "mmm d yyyy") & "#" & " and fhrq >= #" & Format(CDate(Text4.Text), "mmm d yyyy") & "#"
Data7.Refresh
Data7.Recordset.MoveLast
ll = Data7.Recordset.RecordCount
Data7.Recordset.MoveFirst
For pp = 1 To ll
   lje1 = Data7.Recordset("ljje") - Data7.Recordset("dingjin") + lje1
    Data7.Recordset.MoveNext
 Next
 Data7.Recordset.MoveFirst
Text7.Text = lje1
Data8.RecordSource = "select * from qtzm   where  zkmm ='支出' and lrrq <= #" & Format(CDate(Text3.Text), "mmm d yyyy") & "#" & " and lrrq >= #" & Format(CDate(Text4.Text), "mmm d yyyy") & "#"
Data8.Refresh
Data8.Recordset.MoveLast
lll = Data8.Recordset.RecordCount
Data8.Recordset.MoveFirst
For ppp = 1 To lll
   zcse = Data8.Recordset("se") + zcse
    Data8.Recordset.MoveNext
 Next
 Data8.Recordset.MoveFirst
Text5.Text = zcse
Data8.RecordSource = "select * from qtzm   where  zkmm ='收入' and lrrq <= #" & Format(CDate(Text3.Text), "mmm d yyyy") & "#" & " and lrrq >= #" & Format(CDate(Text4.Text), "mmm d yyyy") & "#"
Data8.Refresh
Data8.Recordset.MoveLast
w = Data8.Recordset.RecordCount
Data8.Recordset.MoveFirst
For q = 1 To w
   srse = Data8.Recordset("se") + srse
    Data8.Recordset.MoveNext
 Next
 Data8.Recordset.MoveFirst
Text8.Text = srse
Label14.Caption = Val(Text2.Text) + Val(Text14.Text) + Val(Text5.Text)
Label15.Caption = Val(Text7.Text) + Val(Text6.Text) + Val(Text8.Text)

End Sub

Private Sub Command3_Click()
If Text2.Text <> "0" Or Text14.Text <> "0" Or Text5.Text <> "0" Or Text6.Text <> "0" Or Text7.Text <> "0" Or Text8.Text <> "0" Then
     Response = MsgBox("当前结算结果还没有保存,是否保存?", vbYesNo + vbInformation + vbDefaultButton1, "提示")
    If Response = vbYes Then
             Call Command4_Click
             Unload Me
       Else
             Unload Me
   End If
Else
   Unload Me
End If
   

End Sub

Private Sub Command6_Click()
Unload Me
End Sub

Private Sub Command9_Click()
Unload Me
End Sub

Private Sub Command4_Click()
If Text2.Text = "0" And Text14.Text = "0" And Text5.Text = "0" And Text6.Text = "0" And Text7.Text = "0" And Text8.Text = "0" Then
         MsgBox "结算结果均为零,不予保存。", vbCritical, "警告"
         Exit Sub
 End If
bc = 4
endthis:
If bc = 2 Or bc = 4 Then
        Data9.Recordset.AddNew
        Data9.Recordset("cwjsrq") = Date
        Data9.Recordset("ksrq") = Text4.Text
        Data9.Recordset("jsrq") = Text3.Text
        Data9.Recordset("jhzc") = Val(Text2.Text)
        'Data9.Recordset("gzff") = Val(Text1.Text)
        Data9.Recordset("wfzk") = Val(Text14.Text)
        Data9.Recordset("qtzc") = Val(Text5.Text)
        Data9.Recordset("wszk") = Val(Text7.Text)
        Data9.Recordset("xhsr") = Val(Text6.Text)
        Data9.Recordset("qtsr") = Val(Text8.Text)
        Data9.Recordset.Update
        Data9.Refresh
        MsgBox " 结算的结果已保存 。", vbInformation, "提示"
        Text5.Text = "0"
        Text6.Text = "0"
        Text7.Text = "0"
        Text8.Text = "0"
        Text2.Text = "0"
        Text14.Text = "0"
        bc = 3
  Else
     reponse = MsgBox("结算的结果还没有保存,是否保存?", vbYesNo + vbInformation + vbDefaultButton1, "提示")
     If reponse = vbYes Then
         bc = 2
         GoTo endthis
      Else
        bc = 3
     End If
  End If
End Sub

Private Sub Form_Load()
Text3.Text = Format(Date, "yy-mm-dd")
Text4.Text = Format(Date, "yy-mm-dd")
Data1.DatabaseName = App.Path & "\db1.mdb"
Data1.RecordSource = "select * from jhfkd"
'Data2.DatabaseName = App.Path & "\db1.mdb"
'Data2.RecordSource = "select * from gzffb"
Data3.DatabaseName = App.Path & "\db1.mdb"
Data3.RecordSource = "select * from spdhd"
Data4.DatabaseName = App.Path & "\db1.mdb"
Data4.RecordSource = "select * from spzjrk"
Data5.DatabaseName = App.Path & "\db1.mdb"
Data5.RecordSource = "select * from xhskd"
Data6.DatabaseName = App.Path & "\db1.mdb"
Data6.RecordSource = "select * from spzjck"
Data7.DatabaseName = App.Path & "\db1.mdb"
Data7.RecordSource = "select * from xhdd"
Data8.DatabaseName = App.Path & "\db1.mdb"
Data8.RecordSource = "select * from qtzm"

Data9.DatabaseName = App.Path & "\db1.mdb"
Data9.RecordSource = "select * from cwjs"


End Sub


Private Sub UpDown1_DownClick()
Text3.Text = Format(DateAdd("d", -1, Format(CDate(Text3.Text), "yy-mm-dd")), "yy-mm-dd")

End Sub

Private Sub UpDown1_UpClick()
Text3.Text = Format(DateAdd("d", 1, Format(CDate(Text3.Text), "yy-mm-dd")), "yy-mm-dd")

End Sub

Private Sub UpDown2_Change()
'Call Command4_Click
End Sub

Private Sub UpDown2_DownClick()
Text4.Text = Format(DateAdd("d", -1, Format(CDate(Text4.Text), "yy-mm-dd")), "yy-mm-dd")

End Sub

Private Sub UpDown2_UpClick()
Text4.Text = Format(DateAdd("d", 1, Format(CDate(Text4.Text), "yy-mm-dd")), "yy-mm-dd")

End Sub

⌨️ 快捷键说明

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