frmbyjladd.frm
来自「很好用的通用库存管理程序」· FRM 代码 · 共 205 行
FRM
205 行
VERSION 5.00
Begin VB.Form FrmByJLAdd
BorderStyle = 1 'Fixed Single
Caption = "保养记录_新增"
ClientHeight = 4155
ClientLeft = 45
ClientTop = 435
ClientWidth = 4155
ControlBox = 0 'False
Icon = "FrmByJLAdd.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4155
ScaleWidth = 4155
Begin VB.TextBox Text3
ForeColor = &H80000006&
Height = 735
Left = 1320
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 3
Top = 2400
Width = 2655
End
Begin VB.TextBox Text2
ForeColor = &H80000006&
Height = 735
Left = 1320
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 2
Top = 1560
Width = 2655
End
Begin VB.CommandButton Command2
Caption = "取 消"
Height = 495
Left = 2400
TabIndex = 5
Top = 3420
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "添 加"
Height = 495
Left = 480
TabIndex = 4
Top = 3420
Width = 1095
End
Begin VB.ComboBox Cmb1
Height = 300
Left = 1320
TabIndex = 0
Top = 600
Width = 1935
End
Begin VB.TextBox Text1
ForeColor = &H80000006&
Height = 270
Left = 1320
TabIndex = 1
Top = 1080
Width = 2055
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "备 注"
ForeColor = &H00FF0000&
Height = 180
Left = 360
TabIndex = 10
Top = 2640
Width = 450
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "保养记录详细资料"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00008000&
Height = 255
Left = 1440
TabIndex = 9
Top = 120
Width = 1695
End
Begin VB.Label Label8
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "保养内容:"
ForeColor = &H00FF0000&
Height = 180
Left = 240
TabIndex = 8
Top = 1920
Width = 900
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "保养时间:"
ForeColor = &H00FF0000&
Height = 255
Left = 240
TabIndex = 7
Top = 1080
Width = 975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "维修人员:"
ForeColor = &H00FF0000&
Height = 255
Left = 240
TabIndex = 6
Top = 660
Width = 1095
End
End
Attribute VB_Name = "FrmByJLAdd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Cmb1.Text = "" Then
MsgBox "请选择维修人员!"
Exit Sub
End If
If Text1.Text = "" Then
MsgBox "请填写保养时间!"
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "请填写保养内容!"
Exit Sub
End If
Dim a As Integer
a = MsgBox("********你确定此操作吗?**********" & vbCrLf _
& "维修人员:" & Cmb1.Text & vbCrLf _
& "保养时间:" & Text1.Text & vbCrLf _
& "保养内容:" & Text2.Text & vbCrLf _
, vbExclamation + vbOKCancel + vbApplicationModal, "提示")
If a = 1 Then
sSql = "SELECT * FROM 保养记录"
Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
Rs.AddNew
Rs!保养单号 = Bill
Rs!保养内容 = Text2.Text
Rs!保养时间 = Text1.Text
Rs!维修人员 = Cmb1.Text
If Text3.Text = "" Then Rs!备注 = "-" Else Rs!备注 = Text3.Text
Rs.Update
Rs.Close
MsgBox "添加成功!"
FrmBYJL.Show
Unload Me
End If
If a = 2 Then Exit Sub
End Sub
Private Sub Command2_Click()
FrmBYJL.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
Set_Ygb
Text1.Text = Date
End Sub
Private Sub Set_Ygb() '员工表
Dim i As Integer
'On Error GoTo DataErr
sSql = "SELECT 姓名 FROM 员工表"
Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
Cmb1.Clear
Do While Not Rs.EOF
Cmb1.AddItem Rs.Fields(0)
Rs.MoveNext
Loop
Rs.Close
Exit Sub
'DataErr:
' MsgBox Err.Description
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?