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

📄 frm_zcwx.frm

📁 固定资产及设备管理系统
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         Left            =   360
         TabIndex        =   62
         Top             =   1800
         Width           =   855
      End
      Begin VB.Label Label3 
         Caption         =   "资产/设备编号"
         Height          =   375
         Index           =   1
         Left            =   360
         TabIndex        =   41
         Top             =   360
         Width           =   1335
      End
      Begin VB.Label Label4 
         Caption         =   "资产/设备名称"
         Height          =   375
         Index           =   1
         Left            =   4560
         TabIndex        =   40
         Top             =   360
         Width           =   1335
      End
      Begin VB.Label Label5 
         Caption         =   "型号"
         Height          =   375
         Index           =   1
         Left            =   8520
         TabIndex        =   39
         Top             =   360
         Width           =   1095
      End
      Begin VB.Label Label6 
         Caption         =   "配置"
         Height          =   375
         Index           =   1
         Left            =   360
         TabIndex        =   38
         Top             =   840
         Width           =   975
      End
      Begin VB.Label Label7 
         Caption         =   "送修日期"
         Height          =   375
         Index           =   1
         Left            =   4560
         TabIndex        =   37
         Top             =   840
         Width           =   1215
      End
      Begin VB.Label Label8 
         Caption         =   "故障原因"
         Height          =   375
         Index           =   1
         Left            =   4560
         TabIndex        =   36
         Top             =   1800
         Width           =   855
      End
      Begin VB.Label Label9 
         Caption         =   "维修日期"
         Height          =   375
         Index           =   1
         Left            =   8520
         TabIndex        =   35
         Top             =   840
         Width           =   1215
      End
      Begin VB.Label Label10 
         Caption         =   "维修状况"
         Height          =   255
         Index           =   1
         Left            =   360
         TabIndex        =   34
         Top             =   1320
         Width           =   975
      End
      Begin VB.Label Label11 
         Caption         =   "配件名称"
         Height          =   375
         Index           =   1
         Left            =   4560
         TabIndex        =   33
         Top             =   1320
         Width           =   855
      End
      Begin VB.Label Label12 
         Caption         =   "维修费用"
         Height          =   375
         Index           =   1
         Left            =   8520
         TabIndex        =   32
         Top             =   1320
         Width           =   735
      End
   End
End
Attribute VB_Name = "frm_ZCWX"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim I
'Public adoCon As New ADODB.Connection
'Public adoRs As New ADODB.Recordset

Private Sub Combo1_Click()
If Combo2.Text = " >" Then
I = 0
ElseIf Combo2.Text = " =" Then
I = 1
ElseIf Combo2.Text = " <" Then
I = 2
Else
End If
End Sub

Private Sub Command1_Click()            '维修信息查询
Frame3.Visible = True
Frame2.Visible = False
If Text1.Text = "" Then
MsgBox "输入不能为空", , "提示"
Text1.SetFocus
Else
If Combo1.Text = "资产设备编号" Then
If Asc(Text1.Text) < 48 Or Asc(Text1.Text) > 57 Then
MsgBox "输入数据非法!!", , "提示"
Text1.Text = ""
Text1.SetFocus
Else
End If
ElseIf Combo1.Text = "数量" Then
If Asc(Text1.Text) < 48 Or Asc(Text1.Text) > 57 Then
MsgBox "输入数据非法!!", , "提示"
Text1.Text = ""
Text1.SetFocus
Else
End If
Else
End If
Dim a
a = Text1.Text
If I = 0 Then
Adodc1.RecordSource = "select * from Table_ZCWX where " + Combo1.Text + ">'" + a + "'"
Adodc1.Refresh
ElseIf I = 1 Then
Adodc1.RecordSource = "select * from Table_ZCWX where " + Combo1.Text + "='" + a + "'"
Adodc1.Refresh
ElseIf I = 2 Then
Adodc1.RecordSource = "select * from Table_ZCWX where " + Combo1.Text + "<'" + a + "'"
Adodc1.Refresh
Else
End If
End If
End Sub

Private Sub Command10_Click()
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text20.Text = ""
End Sub

Private Sub Command11_Click()
Frame2.Visible = True
Frame3.Visible = False
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text20.Text = ""
Text9.Text = ""
End Sub

Private Sub Command12_Click()
Frame2.Visible = False
Frame3.Visible = True
End Sub


Private Sub Command14_Click()
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text20.Text = ""
End Sub

Private Sub Command2_Click()
Adodc1.RecordSource = "select * from Table_ZCWX"
Adodc1.Refresh
End Sub

'Private Sub Command3_Click()           '维修信息修改
'    Set adoCon = New ADODB.Connection
'    adoCon.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Data_MRSOFT;Data Source=MRVB"
'
'If Command3.Caption = "编辑" Then
'Command3.Caption = "保存"
'Adodc1.RecordSource = "select * from Table_ZCWX where 资产设备编号='" + Text2.Text + "'"
'Adodc1.Refresh
'    If Adodc1.Recordset.RecordCount > 0 Then
'    Text2.Text = Adodc1.Recordset.Fields("资产设备编号")
'    Text3.Text = Adodc1.Recordset.Fields("资产设备名称")
'    Text4.Text = Adodc1.Recordset.Fields("型号")
'    Text5.Text = Adodc1.Recordset.Fields("配置")
'    Text20.Text = Adodc1.Recordset.Fields("数量")
'    DTPicker1.Value = Adodc1.Recordset.Fields("送修日期")
'    Text6.Text = Adodc1.Recordset.Fields("故障原因")
'    DTPicker2.Value = Adodc1.Recordset.Fields("维修日期")
'    Text7.Text = Adodc1.Recordset.Fields("维修状况")
'    Text8.Text = Adodc1.Recordset.Fields("配件名称")
'    Text9.Text = Adodc1.Recordset.Fields("维修费用")
'    Else
'    End If
'
'ElseIf Command3.Caption = "保存" Then
'Adodc1.RecordSource = "select * from Table_ZCWX where 资产设备编号='" + Text2.Text + "'"
'Adodc1.Refresh
'    If Adodc1.Recordset.RecordCount > 0 Then
'Adodc1.Recordset.Delete
' Set adoRs = adoCon.Execute("insert into Table_ZCWX values(" & Text2 & ",'" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text20 & "','" & DTPicker1 & "','" & Text6 & "','" & DTPicker2 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "')")
'  MsgBox "数据保存成功!!", , "提示"
'Command3.Caption = "编辑"
'Else
'End If
'Else
'End If
'
'End Sub

Private Sub Command4_Click()
 DataEnvironment1.rsCommand2.Open "select * from Table_ZCWX where 资产设备编号 like '" + Text10.Text + "'+ '%'order by 资产设备编号"
 If DataEnvironment1.rsCommand2.RecordCount > 0 Then
 DataRep_ZCWX.Show
 Else
   MsgBox "此设备编号不存在,请确认后重新输入"
 DataEnvironment1.rsCommand2.Close
 End If
End Sub

Private Sub Command5_Click()
CommonDialog1.ShowPrinter
End Sub

Private Sub Command6_Click()
frm_ZCWX.Hide
End Sub

Private Sub Command7_Click()
Command4.Enabled = False
Command5.Enabled = False
Frame2.Visible = True
Frame3.Visible = False
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
End Sub

Private Sub Command8_Click()
Command4.Enabled = True
Command5.Enabled = True
Frame2.Visible = False
Frame3.Visible = True
End Sub

Private Sub Command9_Click()        '维修信息保存
'    Set adoCon = New ADODB.Connection
'    adoCon.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Data_MRSOFT;Data Source=MRVB"
Call main
If Text7.Text = "" Then
MsgBox "请输入维修状况", , "提示"
ElseIf Text8.Text = "" Then
MsgBox "请输入配件名称", , "提示"
ElseIf Text9.Text = "" Then
MsgBox "请输入维修费用", , "提示"
ElseIf Text6.Text = "" Then
MsgBox "请输入故障原因", , "提示"
ElseIf Text20.Text = "" Then
MsgBox "请输入维修数量", , "提示"
Else
 Set adoRs = adoCon.Execute("insert into Table_ZCWX values(" & Text2 & ",'" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text20 & "','" & DTPicker1 & "','" & Text6 & "','" & DTPicker2 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "')")
  MsgBox "数据保存成功!!", , "提示"
  Adodc1.Refresh
  Text7.Text = ""
  Text8.Text = ""
  Text9.Text = ""
  Text6.Text = ""
  Text20.Text = ""
  Text7.SetFocus
  End If
  adoCon.Close
End Sub

Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
DTPicker2.SetFocus
ElseIf KeyCode = 39 Then
DTPicker2.SetFocus
End If
End Sub

Private Sub DTPicker2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text7.SetFocus
ElseIf KeyCode = 39 Then
Text7.SetFocus
End If
End Sub

Private Sub Form_Activate()
Text1.Visible = True
DTPicker3.Visible = False
Text1.SetFocus
If Combo2.Text = " >" Then
I = 0
ElseIf Combo2.Text = " =" Then
I = 1
ElseIf Combo2.Text = " <" Then
I = 2
Else
End If
End Sub

Private Sub Form_Load()
DTPicker1.Value = Date
DTPicker2.Value = Date
End Sub

Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = 13 Then
     Adodc2.RecordSource = "select * from Table_ZCXX where 资产设备编号='" + Text2.Text + "'"
     Adodc2.Refresh
     Text3.SetFocus
     ElseIf KeyCode = 39 Then
     Text3.SetFocus
     End If
End Sub

Private Sub Text20_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text6.SetFocus
ElseIf KeyCode = 39 Then
Text6.SetFocus
End If
End Sub

Private Sub Text20_LostFocus()
If Text20.Text = "" Then
MsgBox "输入不能为空", , "提示"
Else
If Asc(Text20.Text) < 48 Or Asc(Text20.Text) > 57 Then
MsgBox "输入数据非法!!", , "提示"
Text20.Text = ""
Text20.SetFocus
Else
End If
End If
End Sub

Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
     Adodc2.RecordSource = "select * from Table_ZCXX where 资产设备名称='" + Text3.Text + "'"
     Adodc2.Refresh
     DTPicker1.SetFocus
     ElseIf KeyCode = 39 Then
     DTPicker1.SetFocus
     End If
End Sub

Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text8.SetFocus
ElseIf KeyCode = 39 Then
Text8.SetFocus
End If
End Sub

Private Sub Text8_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text9.SetFocus
ElseIf KeyCode = 39 Then
Text9.SetFocus
End If
End Sub

Private Sub Text9_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text20.SetFocus
ElseIf KeyCode = 39 Then
Text20.SetFocus
End If
End Sub

Private Sub Text9_LostFocus()
If Text9.Text = "" Then
MsgBox "输入不能为空", , "提示"
Else
If Asc(Text9.Text) < 48 Or Asc(Text9.Text) > 57 Then
MsgBox "输入数据非法!!", , "提示"
Text9.Text = ""
Text9.SetFocus
Else
End If
End If
End Sub

⌨️ 快捷键说明

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