frm_sbgl_sbda.frm
来自「PMS是一个生产管理系统,功能强大,供大家享用,希望大家支持!!」· FRM 代码 · 共 893 行 · 第 1/3 页
FRM
893 行
Begin VB.Label Label2
Caption = "设备名称"
Height = 180
Left = 75
TabIndex = 5
Top = 600
Width = 810
End
Begin VB.Label Label1
Caption = "设备编号"
Height = 195
Left = 90
TabIndex = 3
Top = 270
Width = 810
End
End
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 705
Left = 0
TabIndex = 0
Top = 0
Width = 8190
_ExtentX = 14446
_ExtentY = 1244
ButtonWidth = 1138
ButtonHeight = 1191
Appearance = 1
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 13
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = " 增加 "
Key = "add"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "修改"
Key = "modify"
ImageIndex = 2
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "删除"
Key = "delete"
ImageIndex = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "保存"
Key = "save"
ImageIndex = 4
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "取消"
Key = "cancel"
ImageIndex = 5
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "查找"
Key = "find"
ImageIndex = 6
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "第一条"
Key = "first"
ImageIndex = 7
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "上一条"
Key = "previous"
ImageIndex = 8
EndProperty
BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "下一条"
Key = "next"
ImageIndex = 9
EndProperty
BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "末一条"
Key = "last"
ImageIndex = 10
EndProperty
BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Style = 3
EndProperty
BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "关闭"
Key = "close"
ImageIndex = 11
EndProperty
EndProperty
BorderStyle = 1
End
Begin MSComctlLib.ImageList ImageList1
Left = -240
Top = 675
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 26
ImageHeight = 26
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 11
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Sbgl_Sbda.frx":003D
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Sbgl_Sbda.frx":1697
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Sbgl_Sbda.frx":2CF1
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Sbgl_Sbda.frx":434B
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Sbgl_Sbda.frx":59A5
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Sbgl_Sbda.frx":6FFF
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Sbgl_Sbda.frx":8659
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Sbgl_Sbda.frx":9CB3
Key = ""
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Sbgl_Sbda.frx":B30D
Key = ""
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Sbgl_Sbda.frx":C967
Key = ""
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_Sbgl_Sbda.frx":DFC1
Key = ""
EndProperty
EndProperty
End
End
Attribute VB_Name = "Frm_Sbgl_Sbda"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer, Myval As Integer '定义整型变量
Public blnadd1 As Boolean
Dim Mystr As String '定义字符变量存储编号信息
Dim Str1 As String
Dim Str2 As String '定义字符变量
Dim Myrs As New ADODB.Recordset ''定义数据集对象
Sub view_data() '定义显示数据的过程
If Adodc1.Recordset.RecordCount > 0 Then
With Dgr_Scsb
If .Columns(0) <> "" Then Text1(0).Text = .Columns(0) Else Text1(0).Text = ""
If .Columns(1) <> "" Then Text1(1).Text = .Columns(1) Else Text1(1).Text = ""
If .Columns(2) <> "" Then Cbx_bm.Text = .Columns(2) Else Cbx_bm.Text = ""
If .Columns(3) <> "" Then Cbx_Sblx.Text = .Columns(3) Else Cbx_Sblx.Text = ""
If .Columns(4) <> "" Then Cbx_Sbzt.Text = .Columns(4) Else Cbx_Sbzt.Text = ""
If .Columns(5) <> "" Then Dtp_Qyrq.Value = .Columns(5) Else Dtp_Qyrq.Value = Date
If .Columns(6) <> "" Then Text1(2).Text = .Columns(6) Else Text1(2).Text = ""
If .Columns(7) <> "" Then Cbx_Txsj.Text = .Columns(7) Else Cbx_Txsj.Text = ""
If .Columns(8) <> "" Then Text1(3).Text = .Columns(8) Else Text1(3).Text = ""
End With
End If
End Sub
Private Sub Cbx_bm_GotFocus()
Cbx_bm.BackColor = &HFFFF80
End Sub
Private Sub Cbx_bm_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Cbx_Sblx.SetFocus
End Sub
Private Sub Cbx_bm_LostFocus()
Cbx_bm.BackColor = &HFFFFFF
Myrs.Open "select * from tb_SCGL_cjsz where cjsz_cjmc='" + Cbx_bm + "'", cnn, adOpenKeyset
If Myrs.RecordCount <= 0 Then
MsgBox "请输入正确的部门信息!", , "信息提示"
Cbx_bm.SetFocus
Cbx_bm.ListIndex = 0
Myrs.Close
Exit Sub
End If
Myrs.Close
End Sub
Private Sub Cbx_Sblx_GotFocus()
Cbx_Sblx.BackColor = &HFFFF80
End Sub
Private Sub Cbx_Sblx_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Cbx_Sbzt.SetFocus
End Sub
Private Sub Cbx_Sblx_LostFocus()
Cbx_Sblx.BackColor = &HFFFFFF
Myrs.Open "select * from tb_SCGL_sblx where sblx_lxmc='" + Cbx_Sblx.Text + "'", cnn, adOpenKeyset
If Myrs.RecordCount <= 0 Then
MsgBox "请输入正确的设备类型!", , "信息提示"
Cbx_Sblx.SetFocus
Cbx_Sblx.ListIndex = 0
Myrs.Close
Exit Sub
End If
Myrs.Close
End Sub
Private Sub Cbx_Sbzt_GotFocus() '设备状态
Cbx_Sbzt.BackColor = &HFFFF80
End Sub
Private Sub Cbx_Sbzt_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Text1(2).SetFocus
End Sub
Private Sub Cbx_Sbzt_LostFocus()
Cbx_Sbzt.BackColor = &HFFFFFF
Myrs.Open "select * from tb_SCGL_sbzt where sbzt_ztmc='" + Cbx_Sbzt.Text + "'", cnn, adOpenKeyset
If Myrs.RecordCount <= 0 Then
MsgBox "请输入正确的设备状态信息!", , "信息提示"
Cbx_Sbzt.SetFocus
Cbx_Sbzt.ListIndex = 0
Myrs.Close
Exit Sub
End If
Myrs.Close
End Sub
Private Sub Cbx_Txsj_GotFocus()
Cbx_Txsj.BackColor = &HFFFF80
End Sub
Private Sub Cbx_Txsj_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Text1(3).SetFocus
End Sub
Private Sub Cbx_Txsj_LostFocus()
Cbx_Txsj.BackColor = &HFFFFFF
If Not IsNumeric(Cbx_Txsj.Text) Then
MsgBox "请选择正确的项目信息", , "信息提示"
Cbx_Txsj.ListIndex = 0
Exit Sub
End If
Myrs.Open "select * from tb_SCGL_sbtx where sbtx_txnx='" + str(Cbx_Txsj.Text) + "'", cnn, adOpenKeyset
If Myrs.RecordCount <= 0 Then
MsgBox "请在列表框中选择项目,或重新设置设备摊销时间!", , "信息提示"
Cbx_Txsj.SetFocus
Cbx_Txsj.ListIndex = 0
Myrs.Close
Exit Sub
End If
Myrs.Close
End Sub
Private Sub Dgr_Scsb_Click()
view_data
End Sub
Private Sub Dtp_Qyrq_GotFocus()
Dtp_Qyrq.CalendarBackColor = &HFFFF80
End Sub
Private Sub Dtp_Qyrq_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Text1(2).SetFocus
End Sub
Private Sub Dtp_Qyrq_LostFocus()
Dtp_Qyrq.CalendarBackColor = &HFFFFFF
End Sub
Private Sub Form_Activate()
Adodc1.ConnectionString = PublicStr
If sql <> "" Then
Adodc1.RecordSource = sql & " order by scsb_sbbh"
Adodc1.Refresh
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?