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

📄 frmdzff.frm

📁 朋友给的
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmDZFF 
   Caption         =   "单证发放"
   ClientHeight    =   6195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   9645
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MDIChild        =   -1  'True
   ScaleHeight     =   6195
   ScaleWidth      =   9645
   Begin VB.Frame Frame3 
      Height          =   6060
      Left            =   7170
      TabIndex        =   12
      Top             =   0
      Width           =   2400
      Begin VB.CommandButton Command1 
         Caption         =   "保存"
         Height          =   450
         Left            =   600
         TabIndex        =   18
         Top             =   630
         Width           =   1410
      End
      Begin VB.CommandButton Command2 
         Caption         =   "删除"
         Height          =   450
         Left            =   600
         TabIndex        =   17
         Top             =   1320
         Width           =   1410
      End
      Begin VB.CommandButton Command3 
         Caption         =   "退出"
         Height          =   450
         Left            =   600
         TabIndex        =   16
         Top             =   2025
         Width           =   1410
      End
      Begin VB.CommandButton Command4 
         Caption         =   "查找"
         Height          =   450
         Left            =   675
         TabIndex        =   15
         Top             =   4065
         Width           =   1410
      End
      Begin VB.TextBox findnr 
         Height          =   300
         Left            =   540
         TabIndex        =   14
         Top             =   3300
         Width           =   1620
      End
      Begin VB.ComboBox findbt 
         Height          =   300
         Left            =   540
         TabIndex        =   13
         Text            =   "查询项目"
         Top             =   2895
         Width           =   1620
      End
   End
   Begin VB.Frame Frame2 
      Height          =   3405
      Left            =   0
      TabIndex        =   10
      Top             =   2670
      Width           =   7155
      Begin MSFlexGridLib.MSFlexGrid MSFLGDZ 
         Height          =   3075
         Left            =   120
         TabIndex        =   11
         Top             =   210
         Width           =   6960
         _ExtentX        =   12277
         _ExtentY        =   5424
         _Version        =   393216
         Cols            =   7
         FormatString    =   "序号  |单证名称        |领用人     |数量   |是否回销   |日期      |ID     "
      End
   End
   Begin VB.Frame Frame1 
      Height          =   2655
      Left            =   0
      TabIndex        =   0
      Top             =   15
      Width           =   7170
      Begin VB.OptionButton Option2 
         Caption         =   "否"
         Height          =   345
         Left            =   3750
         TabIndex        =   20
         Top             =   1980
         Width           =   2160
      End
      Begin VB.OptionButton Option1 
         Caption         =   "是"
         Height          =   345
         Left            =   1845
         TabIndex        =   19
         Top             =   1980
         Width           =   2160
      End
      Begin VB.TextBox DZMC 
         Height          =   300
         Left            =   1245
         TabIndex        =   4
         Top             =   465
         Width           =   2175
      End
      Begin VB.TextBox LYR 
         Height          =   300
         Left            =   4680
         TabIndex        =   3
         Top             =   465
         Width           =   2175
      End
      Begin VB.TextBox LYSL 
         Height          =   300
         Left            =   1245
         TabIndex        =   2
         Top             =   1230
         Width           =   2175
      End
      Begin MSComCtl2.DTPicker LYRQ 
         Height          =   300
         Left            =   4680
         TabIndex        =   1
         Top             =   1230
         Width           =   2175
         _ExtentX        =   3836
         _ExtentY        =   529
         _Version        =   393216
         Format          =   58523649
         CurrentDate     =   38931
      End
      Begin VB.Label Label1 
         Caption         =   "单证名称"
         Height          =   420
         Left            =   420
         TabIndex        =   9
         Top             =   525
         Width           =   990
      End
      Begin VB.Label Label2 
         Caption         =   "领用人"
         Height          =   420
         Left            =   3750
         TabIndex        =   8
         Top             =   525
         Width           =   975
      End
      Begin VB.Label Label3 
         Caption         =   "领用数量"
         Height          =   420
         Left            =   420
         TabIndex        =   7
         Top             =   1297
         Width           =   1125
      End
      Begin VB.Label Label4 
         Caption         =   "领用日期"
         Height          =   420
         Left            =   3795
         TabIndex        =   6
         Top             =   1260
         Width           =   960
      End
      Begin VB.Label Label5 
         Caption         =   "是否回销"
         Height          =   420
         Left            =   420
         TabIndex        =   5
         Top             =   2070
         Width           =   1080
      End
   End
End
Attribute VB_Name = "frmDZFF"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim DZID As Long
Private Sub Command1_Click()
    Dim rs As ADODB.Recordset
    Dim hx As String
    Set rs = New ADODB.Recordset
    On Error GoTo ErrHandle
    If Option1.Value = True Then
        hx = "是"
    Else
        hx = "否"
    End If
    If DZID <> 0 Then
        rs.Open "select * from dzff where id=" & DZID, gCnn, adOpenStatic, adLockReadOnly
        If Not rs.EOF Then
            If MsgBox("ID号为:" & DZID & "的记录已经存在确定修改?,选择“YES”为修改,选择“NO”为增加记录!!", vbYesNo, "系统提问") = vbNo Then
                gCnn.Execute "insert into dzff(dzmc,lyr,lysl,lyrq,sfhx,czy)values('" & DZMC & "','" & LYR & "'," & Val(LYSL) & ",'" & LYRQ & "','" & hx & "','" & gUser & "')"
            Else
                gCnn.Execute "update dzff set dzmc='" & DZMC & "',lysl=" & Val(LYSL) & ",lyrq='" & LYRQ & "',sfhx='" & hx & "' where id=" & DZID
            End If
         End If
    Else
        gCnn.Execute "insert into dzff(dzmc,lyr,lysl,lyrq,sfhx,czy)values('" & DZMC & "','" & LYR & "'," & Val(LYSL) & ",'" & LYRQ & "','" & hx & "','" & gUser & "')"
        DZID = 0

    End If
    MsgBox "保存成功!!"
    ClearTxt
    Call Form_Load
    Exit Sub
ErrHandle:
    MsgBox Err.Description, vbCritical, "系统提示"
End Sub

Private Sub Command2_Click()
    If MsgBox("确定删除ID号为:" & DZID & "的记录?", vbYesNo, "x系统提示") = vbNo Then
        Exit Sub
    Else
        gCnn.Execute "delete from dzff where id=" & DZID
    End If
    MsgBox "删除成功"
    ClearTxt
    Call Form_Load





End Sub

Private Sub ClearTxt()
    DZMC = ""
    LYR = ""
    LYSL = ""
    BXGS = ""




End Sub




Private Sub Command3_Click()
    Unload Me
End Sub

Private Sub Command4_Click()
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    Dim strsql As String
    
    strsql = "select * from  VIEWDZff"
    If Trim(Findbt) <> "" And Trim(findnr) <> "" Then
        strsql = strsql & " where " & Findbt & " like '%" & findnr & "%'"
    End If
    rs.Open strsql, gCnn, adOpenStatic, adLockReadOnly
    If Not rs.EOF Then
        Call FillFLG(Findbt, findnr)
    End If

End Sub
Private Sub FillFLG(CODE1 As String, CODE2 As String)
    Dim rs As ADODB.Recordset
    Dim strsql As String
    Dim i As Long
    Set rs = New ADODB.Recordset
   
    strsql = "select * from  VIEWDZff"
     If CODE1 <> "" Then
        strsql = strsql & " where " & CODE1 & " like '%" & CODE2 & "%'"
    End If
    rs.Open strsql, gCnn, adOpenStatic, adLockReadOnly
    MSFLGDZ.Rows = rs.RecordCount + 1
    For i = 1 To rs.RecordCount
        MSFLGDZ.TextMatrix(i, 0) = i
        MSFLGDZ.TextMatrix(i, 1) = rs("单证名称")
        MSFLGDZ.TextMatrix(i, 2) = rs("领用人")
        MSFLGDZ.TextMatrix(i, 3) = rs("领用数量")
        MSFLGDZ.TextMatrix(i, 4) = rs("是否回销")
        MSFLGDZ.TextMatrix(i, 5) = rs("领用日期")
        MSFLGDZ.TextMatrix(i, 6) = rs("id")
        rs.MoveNext
    Next




End Sub
Private Sub Form_Load()
    If Me.WindowState = 0 Then Me.Move 0, 0, 9765, 6600
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    Dim strsql As String
    Dim i As Long
    rs.Open "select * from VIEWDZff", gCnn, adOpenStatic, adLockReadOnly
    Findbt.Clear
    For i = 0 To rs.Fields.count - 1
        Findbt.AddItem rs.Fields(i).name
    Next
    If rs.State = 1 Then rs.Close
    rs.Open "select * from dzff", gCnn, adOpenStatic, adLockReadOnly
    MSFLGDZ.Rows = rs.RecordCount + 1
    For i = 1 To rs.RecordCount
        MSFLGDZ.TextMatrix(i, 0) = i
        MSFLGDZ.TextMatrix(i, 1) = rs("dzmc")
        MSFLGDZ.TextMatrix(i, 2) = rs("lyr")
        MSFLGDZ.TextMatrix(i, 3) = rs("lysl")
        MSFLGDZ.TextMatrix(i, 4) = rs("sfhx")
        MSFLGDZ.TextMatrix(i, 5) = rs("lyrq")
        MSFLGDZ.TextMatrix(i, 6) = rs("id")
        rs.MoveNext
    Next
    LYRQ = Date
    Command2.Enabled = False
    
End Sub

Private Sub MSFLGDZ_Click()
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    rs.Open "select * from dzff where id=" & Trim(MSFLGDZ.TextMatrix(MSFLGDZ.Row, 6)), gCnn, adOpenStatic, adLockReadOnly
    If Not rs.EOF Then
        DZMC = rs("dzmc")
        LYR = rs("lyr")
        LYSL = rs("lysl")
        LYRQ = rs("lyrq")
        If Trim(rs("sfhx")) = "是" Then
            Option1.Value = True
        Else
            Option2.Value = True
        End If
        DZID = rs("id")
    End If
    Command2.Enabled = True






End Sub

⌨️ 快捷键说明

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