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

📄 chushihua_data.frm

📁 一个医药进存销程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form ChuShiHua_data 
   Caption         =   "初始化数据库"
   ClientHeight    =   3390
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4830
   LinkTopic       =   "Form1"
   ScaleHeight     =   3390
   ScaleWidth      =   4830
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame5 
      Caption         =   "清除库存数据库"
      Height          =   975
      Left            =   2040
      TabIndex        =   2
      Top             =   0
      Width           =   2775
      Begin VB.CommandButton Command2 
         Caption         =   "清  除"
         Height          =   375
         Left            =   600
         TabIndex        =   4
         Top             =   360
         Width           =   1335
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "清除数据库"
      Height          =   2295
      Left            =   0
      TabIndex        =   1
      Top             =   1080
      Width           =   4815
      Begin VB.CommandButton Command6 
         Caption         =   "退    出"
         Height          =   375
         Left            =   2520
         TabIndex        =   22
         Top             =   1680
         Width           =   1815
      End
      Begin VB.CommandButton Command5 
         Caption         =   "清除零售数据库"
         Height          =   375
         Left            =   2520
         TabIndex        =   21
         Top             =   1200
         Width           =   1815
      End
      Begin VB.CommandButton Command4 
         Caption         =   "清除批发数据库"
         Height          =   375
         Left            =   360
         TabIndex        =   20
         Top             =   1680
         Width           =   1815
      End
      Begin VB.CommandButton Command3 
         Caption         =   "清除进货数据库"
         Height          =   375
         Left            =   360
         TabIndex        =   19
         Top             =   1200
         Width           =   1815
      End
      Begin VB.ComboBox Combo2 
         Height          =   300
         Left            =   1080
         TabIndex        =   10
         Text            =   "Combo2"
         Top             =   240
         Width           =   735
      End
      Begin VB.ComboBox Combo3 
         Height          =   300
         Left            =   2040
         TabIndex        =   9
         Text            =   "Combo3"
         Top             =   240
         Width           =   615
      End
      Begin VB.ComboBox Combo4 
         Height          =   300
         Left            =   2880
         TabIndex        =   8
         Text            =   "Combo4"
         Top             =   240
         Width           =   615
      End
      Begin VB.ComboBox Combo5 
         Height          =   300
         Left            =   1080
         TabIndex        =   7
         Text            =   "Combo5"
         Top             =   720
         Width           =   735
      End
      Begin VB.ComboBox Combo6 
         Height          =   300
         Left            =   2040
         TabIndex        =   6
         Text            =   "Combo6"
         Top             =   720
         Width           =   615
      End
      Begin VB.ComboBox Combo7 
         Height          =   300
         Left            =   2880
         TabIndex        =   5
         Text            =   "Combo7"
         Top             =   720
         Width           =   615
      End
      Begin VB.Label Label1 
         Caption         =   "日"
         Height          =   255
         Left            =   3480
         TabIndex        =   18
         Top             =   720
         Width           =   255
      End
      Begin VB.Label Label2 
         Caption         =   "日期范围:"
         Height          =   255
         Left            =   120
         TabIndex        =   17
         Top             =   240
         Width           =   975
      End
      Begin VB.Label Label3 
         Caption         =   "年"
         Height          =   255
         Left            =   1800
         TabIndex        =   16
         Top             =   360
         Width           =   255
      End
      Begin VB.Label Label4 
         Caption         =   "月"
         Height          =   255
         Left            =   2640
         TabIndex        =   15
         Top             =   360
         Width           =   255
      End
      Begin VB.Label Label5 
         Caption         =   "日"
         Height          =   255
         Left            =   3480
         TabIndex        =   14
         Top             =   360
         Width           =   255
      End
      Begin VB.Label Label6 
         Caption         =   "年"
         Height          =   255
         Left            =   1800
         TabIndex        =   13
         Top             =   840
         Width           =   255
      End
      Begin VB.Label Label7 
         Caption         =   "月"
         Height          =   255
         Left            =   2640
         TabIndex        =   12
         Top             =   840
         Width           =   255
      End
      Begin VB.Label Label9 
         Caption         =   "至"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   840
         TabIndex        =   11
         Top             =   600
         Width           =   255
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "清除药品数据库"
      Height          =   975
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   1935
      Begin VB.CommandButton Command1 
         Caption         =   "清  除"
         Height          =   375
         Left            =   480
         TabIndex        =   3
         Top             =   360
         Width           =   1095
      End
   End
End
Attribute VB_Name = "ChuShiHua_data"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Trecordset As New ADODB.Recordset
Private Sub Command1_Click()
    If MsgBox("您确实清除药品基础数据吗?如果操作,药品基础数据需要重新输入!", vbYesNo + vbInformation, "提示") = vbYes Then
    If Trecordset.State = 1 Then Trecordset.Close
    With Trecordset
         Set .ActiveConnection = SGWConnection
         .CursorLocation = adUseServer
         .CursorType = adOpenKeyset
         .LockType = adLockOptimistic
         .Source = "Select * from yaopin"
         .Open
    End With
        If Trecordset.RecordCount <= 0 Then Exit Sub: Trecordset.Close

    Trecordset.MoveFirst
    For i = 0 To Trecordset.RecordCount - 1
       Trecordset.Delete
       Trecordset.MoveNext

    Next i
       MsgBox "药品基础数据库已清除完毕!", vbOKOnly + vbInformation, "提示"
    End If
    Trecordset.Close
End Sub

Private Sub Command2_Click()
    If MsgBox("您确实清除库存数据吗?如果操作,库存数据将不能恢复!", vbYesNo + vbInformation, "提示") = vbYes Then
    If Trecordset.State = 1 Then Trecordset.Close
    With Trecordset
         Set .ActiveConnection = SGWConnection
         .CursorLocation = adUseServer
         .CursorType = adOpenKeyset
         .LockType = adLockOptimistic
         .Source = "Select * from kucun"
         .Open
    End With
        If Trecordset.RecordCount <= 0 Then Exit Sub: Trecordset.Close

    Trecordset.MoveFirst

    For i = 0 To Trecordset.RecordCount - 1
       Trecordset.Delete
       Trecordset.MoveNext

    Next i
       MsgBox "库存数据库已清除完毕!", vbOKOnly + vbInformation, "提示"
    End If
    Trecordset.Close
End Sub

Private Sub Command3_Click()
    If MsgBox("您确实清除进货数据吗?如果操作,进货数据将不能恢复!", vbYesNo + vbInformation, "提示") = vbYes Then
    If Trecordset.State = 1 Then Trecordset.Close
    With Trecordset
         Set .ActiveConnection = SGWConnection
         .CursorLocation = adUseServer
         .CursorType = adOpenKeyset
         .LockType = adLockOptimistic
         .Source = "Select * from jinhuo where  shijian>=cdate('" & Trim(Combo2.Text) & "-" & Trim(Combo3.Text) & "-" & Trim(Combo4.Text) & "') and shijian<=cdate('" & Trim(Combo5.Text) & "-" & Trim(Combo6.Text) & "-" & Trim(Combo7.Text) & "')"
         .Open
    End With
    If Trecordset.RecordCount <= 0 Then Exit Sub: Trecordset.Close

    Trecordset.MoveFirst

    For i = 0 To Trecordset.RecordCount - 1
       Trecordset.Delete
       Trecordset.MoveNext
    Next i
       MsgBox "进货数据库已清除完毕!", vbOKOnly + vbInformation, "提示"
    End If
    Trecordset.Close
End Sub

Private Sub Command4_Click()
    If MsgBox("您确实清除批发数据吗?如果操作,批发数据将不能恢复!", vbYesNo + vbInformation, "提示") = vbYes Then
    If Trecordset.State = 1 Then Trecordset.Close
    With Trecordset
         Set .ActiveConnection = SGWConnection
         .CursorLocation = adUseServer
         .CursorType = adOpenKeyset
         .LockType = adLockOptimistic
         .Source = "Select * from pifa where  shijian>=cdate('" & Trim(Combo2.Text) & "-" & Trim(Combo3.Text) & "-" & Trim(Combo4.Text) & "') and shijian<=cdate('" & Trim(Combo5.Text) & "-" & Trim(Combo6.Text) & "-" & Trim(Combo7.Text) & "')"
         .Open
    End With
    If Trecordset.RecordCount <= 0 Then Exit Sub: Trecordset.Close
    Trecordset.MoveFirst

    For i = 0 To Trecordset.RecordCount - 1
       Trecordset.Delete
       Trecordset.MoveNext

    Next i
       MsgBox "批发数据库已清除完毕!", vbOKOnly + vbInformation, "提示"
    End If
    Trecordset.Close
End Sub

Private Sub Command5_Click()
    If MsgBox("您确实清除零售数据吗?如果操作,零售数据将不能恢复!", vbYesNo + vbInformation, "提示") = vbYes Then
    If Trecordset.State = 1 Then Trecordset.Close
    With Trecordset
         Set .ActiveConnection = SGWConnection
         .CursorLocation = adUseServer
         .CursorType = adOpenKeyset
         .LockType = adLockOptimistic
         .Source = "Select * from lingshou where  shijian>=cdate('" & Trim(Combo2.Text) & "-" & Trim(Combo3.Text) & "-" & Trim(Combo4.Text) & "') and shijian<=cdate('" & Trim(Combo5.Text) & "-" & Trim(Combo6.Text) & "-" & Trim(Combo7.Text) & "')"
         .Open
    End With
    If Trecordset.RecordCount <= 0 Then Exit Sub: Trecordset.Close
    Trecordset.MoveFirst

    For i = 0 To Trecordset.RecordCount - 1
       Trecordset.Delete
       Trecordset.MoveNext

    Next i
       MsgBox "零售数据库已清除完毕!", vbOKOnly + vbInformation, "提示"
    End If
    Trecordset.Close
End Sub

Private Sub Command6_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    'set the window in the middle
    Me.Left = (Screen.Width - Me.Width) / 2
    Me.Top = (Screen.Height - Me.Height) / 2
    'init the combobox
    Combo2.Clear
    Combo3.Clear
    Combo4.Clear
    Combo5.Clear
    Combo6.Clear
    Combo7.Clear
    For i = 1980 To Year(Date)
        Combo2.AddItem i
        Combo5.AddItem i
    Next
    Combo2.Text = Year(Date) - 1
    Combo5.Text = Year(Date)
    For i = 1 To 12
        Combo3.AddItem i
        Combo6.AddItem i
    Next
    Combo3.Text = Month(Date)
    Combo6.Text = Month(Date)
    For i = 1 To 31
        Combo4.AddItem i
        Combo7.AddItem i
    Next
    Combo4.Text = Day(Date)
    Combo7.Text = Day(Date)
End Sub

⌨️ 快捷键说明

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