📄 frmbyjl.frm
字号:
VERSION 5.00
Begin VB.Form FrmBYJL
BorderStyle = 0 'None
Caption = "保养记录"
ClientHeight = 5910
ClientLeft = 0
ClientTop = 105
ClientWidth = 9870
ControlBox = 0 'False
LinkTopic = "Form2"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5910
ScaleWidth = 9870
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command2
Caption = "打 印"
Height = 375
Left = 5760
TabIndex = 15
Top = 5400
Width = 855
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000000&
ForeColor = &H80000008&
Height = 4215
Left = 0
ScaleHeight = 4185
ScaleWidth = 9705
TabIndex = 2
Top = 1080
Width = 9735
Begin VB.Label Label3
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "操 作"
ForeColor = &H80000008&
Height = 255
Left = 7560
TabIndex = 14
Top = 0
Width = 1455
End
Begin VB.Label LabBZ
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "备注"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 5760
TabIndex = 9
Top = 0
Width = 1815
End
Begin VB.Label LabXG
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00FFC0C0&
BorderStyle = 1 'Fixed Single
Caption = "修 改"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 7560
TabIndex = 8
Top = 0
Width = 735
End
Begin VB.Label LabWXRY
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "维修人员"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 4560
TabIndex = 7
Top = 0
Width = 1215
End
Begin VB.Label LabBYSJ
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "保养时间"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 2520
TabIndex = 6
Top = 0
Width = 2055
End
Begin VB.Label LabBYNR
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "保养内容"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 600
TabIndex = 5
Top = 0
Width = 1935
End
Begin VB.Label LabBh
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "编号"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 0
TabIndex = 4
Top = 0
Width = 615
End
Begin VB.Label LabDel
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00C0C0FF&
BorderStyle = 1 'Fixed Single
Caption = "删 除"
ForeColor = &H80000008&
Height = 255
Index = 0
Left = 8280
TabIndex = 3
Top = 0
Width = 735
End
End
Begin VB.CommandButton Command4
Caption = "新 添"
Height = 375
Left = 7200
TabIndex = 1
Top = 5400
Width = 855
End
Begin VB.CommandButton Command3
Caption = "关 闭"
Height = 375
Left = 8400
TabIndex = 0
Top = 5400
Width = 975
End
Begin VB.Label LabNmae
Caption = "临沂市长安物贸有限公司保养记录"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 2640
TabIndex = 13
Top = 240
Width = 4095
End
Begin VB.Label Label1
Caption = "微机操作员:"
Height = 255
Left = 0
TabIndex = 12
Top = 5520
Width = 1095
End
Begin VB.Label LabBill
AutoSize = -1 'True
Caption = "生成中......"
ForeColor = &H000000FF&
Height = 180
Left = 1440
TabIndex = 11
Top = 600
Width = 1080
End
Begin VB.Label Label2
Caption = "表单编号:"
Height = 255
Left = 240
TabIndex = 10
Top = 600
Width = 975
End
End
Attribute VB_Name = "FrmBYJL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Private Sub Command2_Click()
SqlBase = "SELECT * FROM 保养记录 where 保养单号= '" & Bill & "'"
PublicPath = App.Path & "\byjl.rpt"
FrmPrinter.Show
End Sub
Private Sub Command3_Click()
Bill = ""
Unload Me
End Sub
Private Sub Command4_Click()
FrmByJLAdd.Show
Unload Me
End Sub
Private Sub Form_Load()
Me.Top = MDIFrmMain.Height / 2 - Me.Height / 2 - 1000
Me.Left = MDIFrmMain.Width / 2 - Me.Width / 2
Set Rs = New Recordset
LabBill = Bill
Set_Init
End Sub
Private Sub Set_Init() '显示内容
sSql = "SELECT Id,保养内容,保养时间,维修人员,备注 FROM 保养记录 where 保养单号= '" & Bill & "'"
Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
i = 1
Do While Not Rs.EOF
Load LabBh(i)
Load LabBYNR(i)
Load LabBYSJ(i)
Load LabWXRY(i)
Load LabBZ(i)
Load LabXG(i)
Load LabDel(i)
LabBh(i).Top = LabBh(i - 1).Top + 255
LabBYNR(i).Top = LabBYNR(i - 1).Top + 255
LabBYSJ(i).Top = LabBYSJ(i - 1).Top + 255
LabWXRY(i).Top = LabWXRY(i - 1).Top + 255
LabBZ(i).Top = LabBZ(i - 1).Top + 255
LabXG(i).Top = LabXG(i - 1).Top + 255
LabDel(i).Top = LabDel(i - 1).Top + 255
LabBh(i).Visible = True:
LabBYNR(i).Visible = True
LabBYSJ(i).Visible = True
LabWXRY(i).Visible = True
LabBZ(i).Visible = True
LabXG(i).Visible = True
LabDel(i).Visible = True
LabBh(i) = i
LabBYNR(i) = Rs("保养内容")
LabBYSJ(i) = Rs("保养时间")
LabWXRY(i) = Rs("维修人员")
If Rs("备注") = "-" Then LabBZ(i) = "" Else LabBZ(i) = Rs("备注")
LabXG(i).LinkItem = Rs("id")
LabDel(i).LinkItem = Rs("id")
i = i + 1
Rs.MoveNext
Loop
Rs.Close
End Sub
Private Sub LabDel_Click(Index As Integer)
Dim a As Integer
a = MsgBox("********你确定要删除此保养记录吗?**********" & vbCrLf _
& "一旦删除将不可更改!" & vbCrLf _
, vbExclamation + vbOKCancel + vbApplicationModal, "提示")
If a = 1 Then
sSql = "delete FROM 保养记录 where ID =" & Val(LabDel(Index).LinkItem)
Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
Set_Unload
Set_Init
End If
If a = 2 Then Exit Sub
End Sub
Private Sub LabXG_Click(Index As Integer)
RemId = Val(LabXG(Index).LinkItem)
FrmByJLXG.Show
Unload Me
End Sub
Private Sub Set_Unload() '卸载各lab
For i = 1 To LabBh.Count - 1
Unload LabBh(i)
Unload LabBYNR(i)
Unload LabBYSJ(i)
Unload LabWXRY(i)
Unload LabBZ(i)
Unload LabXG(i)
Unload LabDel(i)
Next i
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -