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

📄 form3.frm

📁 打印方面的程序
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         BackColor       =   &H00FFC0C0&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   4560
         TabIndex        =   27
         Top             =   3600
         Width           =   1695
      End
      Begin VB.Label bmzg 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   1200
         TabIndex        =   26
         Top             =   3600
         Width           =   1575
      End
      Begin VB.Label jyr 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   4560
         TabIndex        =   25
         Top             =   720
         Width           =   1455
      End
      Begin VB.Label jyrdw 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   1320
         TabIndex        =   24
         Top             =   720
         Width           =   1575
      End
      Begin VB.Label Label9 
         Alignment       =   2  'Center
         BackColor       =   &H00FFC0C0&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   375
         Left            =   3240
         TabIndex        =   23
         Top             =   240
         Width           =   1695
      End
      Begin VB.Label Label4 
         BackColor       =   &H00FFC0C0&
         Caption         =   "借用单详细情况"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   1
         Left            =   5280
         TabIndex        =   22
         Top             =   240
         Width           =   2175
      End
      Begin VB.Label Label7 
         BackColor       =   &H00FFC0C0&
         Caption         =   "制单:"
         Height          =   255
         Left            =   6960
         TabIndex        =   13
         Top             =   3600
         Width           =   735
      End
      Begin VB.Label Label6 
         BackColor       =   &H00FFC0C0&
         Caption         =   "经办人:"
         Height          =   255
         Left            =   3600
         TabIndex        =   12
         Top             =   3600
         Width           =   1215
      End
      Begin VB.Label Label5 
         BackColor       =   &H00FFC0C0&
         Caption         =   "部门主管:"
         Height          =   255
         Left            =   240
         TabIndex        =   11
         Top             =   3600
         Width           =   1095
      End
      Begin VB.Label Label4 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFC0C0&
         Caption         =   "单据号为"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   0
         Left            =   1680
         TabIndex        =   10
         Top             =   240
         Width           =   1215
      End
      Begin VB.Label Label3 
         BackColor       =   &H00FFC0C0&
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   7440
         TabIndex        =   9
         Top             =   720
         Width           =   1455
      End
      Begin VB.Label Label2 
         BackColor       =   &H00FFC0C0&
         Caption         =   "借用人:"
         Height          =   255
         Left            =   3600
         TabIndex        =   8
         Top             =   720
         Width           =   1095
      End
      Begin VB.Label Label1 
         BackColor       =   &H00FFC0C0&
         Caption         =   "借用人单位:"
         Height          =   255
         Left            =   120
         TabIndex        =   7
         Top             =   720
         Width           =   1215
      End
   End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim chaxunziduan As String

Private Sub Adodc3_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
If Adodc3.Recordset.Fields("归还状态").Value = "已归还" Then
   ghzt.Caption = "已归还"
   If Not IsNull(Adodc3.Recordset.Fields("归还时间").Value) Then
      ghsj.Caption = Adodc3.Recordset.Fields("归还时间").Value
   Else
      ghsj.Caption = ""
   End If
Else
   ghzt.Caption = "未归还"
   ghsj.Caption = "未知"

End If

End Sub

Private Sub Command1_Click()
If Adodc3.Recordset.EOF Or Adodc3.Recordset.BOF Then
   MsgBox "请选择要删除的物资!"
   Exit Sub
End If

mmg = MsgBox("确实要删除当前物资吗?", vbYesNo)
If mmg = vbYes Then
   Adodc3.Recordset.Delete
   
   Adodc2.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curpath + "wupin.mdb;Persist Security Info=False"
   Adodc2.CommandType = adCmdText
   Adodc2.RecordSource = "select distinct(单据号) as 验收单 from wuzi where " & chaxunziduan & " like '%" & Text1.Text & "%'" & "  order by 单据号 desc"
   Adodc2.Refresh

    If Adodc2.Recordset.EOF And Adodc2.Recordset.BOF Then
     '********************
     '有代码需要填写

    Else
       List1.Clear                  '先将list 控件内容清空
       Adodc2.Recordset.MoveFirst
       Do Until Adodc2.Recordset.EOF
          List1.AddItem Adodc2.Recordset.Fields("验收单").Value
          Adodc2.Recordset.MoveNext
       Loop
       List1.ListIndex = 0
   
    End If
End If


MsgBox "归还完毕!"

End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Form_Load()

If Right(App.path, 1) = "\" Then ' 若 App.Path 为根目录
curpath = App.path
Else
curpath = App.path + "\"
End If

chaxunziduan = "资产编号"


End Sub

Private Sub ghcx_Click()

If Text1.Text = "" Then
   Exit Sub
End If
Adodc2.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curpath + "wupin.mdb;Persist Security Info=False"
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = "select distinct(单据号) as 验收单 from wuzi where " & chaxunziduan & " like '%" & Text1.Text & "%'" & "  order by 单据号 desc"
Adodc2.Refresh

If Adodc2.Recordset.EOF And Adodc2.Recordset.BOF Then
'********************
'有代码需要填写

Else
   List1.Clear                  '先将list 控件内容清空
   Adodc2.Recordset.MoveFirst
   Do Until Adodc2.Recordset.EOF
      List1.AddItem Adodc2.Recordset.Fields("验收单").Value
      Adodc2.Recordset.MoveNext
   Loop
   List1.ListIndex = 0
   
   
   Adodc1.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curpath + "wupin.mdb;Persist Security Info=False"
   Adodc1.CommandType = adCmdText
   Adodc1.RecordSource = "select * from wuzi where 单据号 = '" & List1.Text & "'"
   Adodc1.Refresh

   jyrdw.Caption = Adodc1.Recordset.Fields("借用人单位").Value
   jyr.Caption = Adodc1.Recordset.Fields("借用人").Value
   Label3.Caption = Adodc1.Recordset.Fields("时间").Value
   bmzg.Caption = Adodc1.Recordset.Fields("部门主管").Value
   jbr.Caption = Adodc1.Recordset.Fields("经办人").Value
   zd.Caption = Adodc1.Recordset.Fields("制单").Value
   Label9.Caption = List1.Text

   Adodc3.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curpath + "wupin.mdb;Persist Security Info=False"
   Adodc3.CommandType = adCmdText
   Adodc3.RecordSource = "select * from wuzi where 单据号 = '" & List1.Text & "' and " & chaxunziduan & " like '%" & Text1.Text & "%'"
   Adodc3.Refresh

End If
End Sub

Private Sub guihuan_Click()
If Adodc3.Recordset.EOF Or Adodc3.Recordset.BOF Then
   MsgBox "请选择要归还的物资!"
   Exit Sub
End If

Adodc3.Recordset.Fields("归还状态").Value = "已归还"
Adodc3.Recordset.Fields("归还时间").Value = Date
Adodc3.Recordset.Update


   ghzt.Caption = "已归还"
   If Not IsNull(Adodc3.Recordset.Fields("归还时间").Value) Then
      ghsj.Caption = Adodc3.Recordset.Fields("归还时间").Value
   Else
      ghsj.Caption = ""
   End If

MsgBox "归还完毕!"
End Sub

Private Sub List1_Click()
   Adodc1.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curpath + "wupin.mdb;Persist Security Info=False"
   Adodc1.CommandType = adCmdText
   Adodc1.RecordSource = "select * from wuzi where 单据号 = '" & List1.Text & "'"
   Adodc1.Refresh

   jyrdw.Caption = Adodc1.Recordset.Fields("借用人单位").Value
   jyr.Caption = Adodc1.Recordset.Fields("借用人").Value
   Label3.Caption = Adodc1.Recordset.Fields("时间").Value
   bmzg.Caption = Adodc1.Recordset.Fields("部门主管").Value
   jbr.Caption = Adodc1.Recordset.Fields("经办人").Value
   zd.Caption = Adodc1.Recordset.Fields("制单").Value
   Label9.Caption = List1.Text

   Adodc3.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curpath + "wupin.mdb;Persist Security Info=False"
   Adodc3.CommandType = adCmdText
   Adodc3.RecordSource = "select * from wuzi where 单据号 = '" & List1.Text & "' and " & chaxunziduan & " like '%" & Text1.Text & "%'"
   Adodc3.Refresh
   


End Sub

Private Sub Option1_Click()
If Option1.Value = True Then
   chaxunziduan = "资产编号"
   Text1.SetFocus
End If


End Sub

Private Sub Option2_Click()
If Option2.Value = True Then
   chaxunziduan = "名称"
   Text1.SetFocus
End If

End Sub

Private Sub Option3_Click()
If Option1.Value = True Then
   chaxunziduan = "借用人"
   Text1.SetFocus
End If
End Sub

Private Sub Option5_Click()
If Option1.Value = True Then
   chaxunziduan = "单据号"
   Text1.SetFocus
End If

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
   Call ghcx_Click
End If
End Sub

⌨️ 快捷键说明

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