📄 frmadduser.frm
字号:
VERSION 5.00
Object = "{E95A2510-F3D1-416D-823B-4F840FE98091}#3.0#0"; "COMMAND.OCX"
Begin VB.Form frmAddUser
Caption = "frmAddUser—新申请"
ClientHeight = 3975
ClientLeft = 60
ClientTop = 345
ClientWidth = 5415
ForeColor = &H00404080&
Icon = "frmAddUser.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
Picture = "frmAddUser.frx":2CFA
ScaleHeight = 3975
ScaleWidth = 5415
Begin VB.TextBox Text1
BorderStyle = 0 'None
Enabled = 0 'False
Height = 180
Index = 6
Left = 3960
TabIndex = 13
Top = 1800
Width = 975
End
Begin VB.TextBox Text1
BorderStyle = 0 'None
Enabled = 0 'False
Height = 180
Index = 5
Left = 3960
TabIndex = 12
Top = 1440
Width = 975
End
Begin VB.TextBox Text1
BorderStyle = 0 'None
Enabled = 0 'False
Height = 180
Index = 4
Left = 3960
TabIndex = 11
Top = 1080
Width = 975
End
Begin VB.TextBox Text1
BorderStyle = 0 'None
Enabled = 0 'False
Height = 180
Index = 3
Left = 1440
TabIndex = 10
Top = 2160
Width = 975
End
Begin VB.TextBox Text1
BorderStyle = 0 'None
Enabled = 0 'False
Height = 180
Index = 2
Left = 1440
TabIndex = 9
Top = 1800
Width = 975
End
Begin VB.TextBox Text1
BorderStyle = 0 'None
Enabled = 0 'False
Height = 180
Index = 1
Left = 1440
TabIndex = 8
Top = 1440
Width = 975
End
Begin VB.TextBox Text1
BorderStyle = 0 'None
Enabled = 0 'False
Height = 180
Index = 0
Left = 1440
TabIndex = 7
Top = 1080
Width = 975
End
Begin CSCommand.Command cmdLast
Height = 375
Left = 4560
TabIndex = 14
Top = 2760
Width = 375
_ExtentX = 661
_ExtentY = 661
IconAlign = 0
Icon = "frmAddUser.frx":7EB0F
Caption = ">|"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontColor = 255
End
Begin CSCommand.Command cmdNext
Height = 375
Left = 4200
TabIndex = 15
Top = 2760
Width = 375
_ExtentX = 661
_ExtentY = 661
IconAlign = 0
Icon = "frmAddUser.frx":7EB2B
Caption = ">"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontColor = 255
End
Begin CSCommand.Command cmdPriv
Height = 375
Left = 3840
TabIndex = 16
Top = 2760
Width = 375
_ExtentX = 661
_ExtentY = 661
IconAlign = 0
Icon = "frmAddUser.frx":7EB47
Caption = "<"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontColor = 255
End
Begin CSCommand.Command cmdFrist
Height = 375
Left = 3480
TabIndex = 17
Top = 2760
Width = 375
_ExtentX = 661
_ExtentY = 661
IconAlign = 0
Icon = "frmAddUser.frx":7EB63
Caption = "|<"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontColor = 255
End
Begin CSCommand.Command cmdAdd
Height = 375
Left = 1320
TabIndex = 18
Top = 3360
Width = 615
_ExtentX = 1085
_ExtentY = 661
IconAlign = 0
Icon = "frmAddUser.frx":7EB7F
Caption = "&添加"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Appearance = 2
BackStyle = 0
End
Begin CSCommand.Command cmdSave
Height = 375
Left = 2520
TabIndex = 19
Top = 3360
Width = 615
_ExtentX = 1085
_ExtentY = 661
IconAlign = 0
Icon = "frmAddUser.frx":7EB9B
Enabled = 0 'False
Caption = "&提交"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Appearance = 2
BackStyle = 0
End
Begin CSCommand.Command cmdExit
Height = 375
Left = 3720
TabIndex = 20
Top = 3360
Width = 615
_ExtentX = 1085
_ExtentY = 661
IconAlign = 0
Icon = "frmAddUser.frx":7F875
Caption = "&退出"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Appearance = 2
BackStyle = 0
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "产 品 申 请"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00008080&
Height = 315
Index = 8
Left = 1560
TabIndex = 21
Top = 240
Width = 1875
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "产品名称:"
ForeColor = &H00008080&
Height = 180
Index = 7
Left = 480
TabIndex = 6
Top = 1440
Width = 810
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "数量:"
ForeColor = &H00008080&
Height = 180
Index = 5
Left = 480
TabIndex = 5
Top = 1800
Width = 450
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "订购时间:"
ForeColor = &H00008080&
Height = 180
Index = 4
Left = 480
TabIndex = 4
Top = 2160
Width = 810
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "单位:"
ForeColor = &H00008080&
Height = 180
Index = 3
Left = 3000
TabIndex = 3
Top = 1080
Width = 450
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "价格:"
ForeColor = &H00008080&
Height = 180
Index = 2
Left = 3000
TabIndex = 2
Top = 1440
Width = 450
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "状态:"
ForeColor = &H00008080&
Height = 180
Index = 1
Left = 3000
TabIndex = 1
Top = 1800
Width = 450
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "产品编号:"
ForeColor = &H00008080&
Height = 180
Index = 0
Left = 480
TabIndex = 0
Top = 1080
Width = 810
End
End
Attribute VB_Name = "frmAddUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Add As ADODB.Recordset
Dim Add1 As String
Private Sub cmdAdd_Click()
FillEnable
FillTexts1
Text1(0).SetFocus
cmdSave.Enabled = True
cmdAdd.Enabled = False
cmdExit.Enabled = False
End Sub
Private Sub cmdExit_Click()
If MsgBox("确实要退出?", vbYesNo + vbQuestion, "产品添加-退出") = vbYes Then
Unload Me
Else
Exit Sub
End If
End Sub
Private Sub cmdFrist_Click()
If Add.RecordCount <= 0 Then Exit Sub
Add.MoveFirst
FillTexts
End Sub
Private Sub cmdLast_Click()
If Add.RecordCount <= 0 Then Exit Sub
Add.MoveLast
FillTexts
End Sub
Private Sub cmdNext_Click()
If Add.RecordCount <= 0 Then Exit Sub
Add.MoveNext
If Add.EOF Then
MsgBox "记录已到底", vbOKOnly + vbExclamation, "记录浏览"
Add.MoveLast
End If
FillTexts
End Sub
Private Sub cmdPriv_Click()
If Add.RecordCount <= 0 Then Exit Sub
Add.MovePrevious
If Add.BOF Then
MsgBox "记录已到顶", vbOKOnly + vbExclamation, "记录浏览"
Add.MoveFirst
End If
FillTexts
End Sub
Private Sub cmdSave_Click()
If Text1(0).Text = "" Then
MsgBox "编号不容许为空,请认真填写!", vbOKOnly + vbExclamation, "字段检查"
Text1(0).SetFocus
Add.CancelUpdate
Exit Sub
ElseIf Text1(1).Text = "" Then
MsgBox "产品名不容许为空,请认真填写!", vbOKOnly + vbExclamation, "字段检查"
Text1(1).SetFocus
Add.CancelUpdate
Exit Sub
ElseIf Text1(2).Text = "" Then
MsgBox "数量不容许为空,请认真填写!", vbOKOnly + vbExclamation, "字段检查"
Text1(2).SetFocus
Add.CancelUpdate
Exit Sub
ElseIf Text1(3).Text = "" Then
MsgBox "订购时间不容许为空,请认真填写!", vbOKOnly + vbExclamation, "字段检查"
Text1(3).SetFocus
Add.CancelUpdate
Exit Sub
ElseIf Text1(4).Text = "" Then
MsgBox "单位不容许为空,请认真填写!", vbOKOnly + vbExclamation, "字段检查"
Text1(4).SetFocus
Add.CancelUpdate
Exit Sub
ElseIf Text1(5).Text = "" Then
MsgBox "价格不容许为空,请认真填写!", vbOKOnly + vbExclamation, "字段检查"
Text1(5).SetFocus
Add.CancelUpdate
Exit Sub
End If
Add.AddNew
FillTextUp
Add.Update
Add.MoveFirst
FillTexts
FillEnable1
cmdAdd.Enabled = True
cmdSave.Enabled = False
cmdExit.Enabled = True
End Sub
Private Sub Form_Load()
Set Add = New Recordset
Add1 = "Select * from OrderMsg"
Add.Open Add1, cnStr, adOpenKeyset, adLockOptimistic, adCmdText
FillTexts
frmAddUser.Width = 5535
frmAddUser.Height = 4380
End Sub
Private Sub FillTexts()
If Add.RecordCount <= 0 Then Exit Sub
Dim i As Integer
For i = 0 To 6
Text1(i) = Add(i)
Next
End Sub
Private Sub FillTexts1()
If Add.RecordCount <= 0 Then Exit Sub
Dim i As Integer
For i = 0 To 5
Text1(i) = ""
Next
Text1(6).Text = "未审批"
Text1(6).Enabled = False
End Sub
Private Sub FillEnable()
Dim i As Integer
For i = 0 To 6
Text1(i).Enabled = True
Next
End Sub
Private Sub FillEnable1()
Dim i As Integer
For i = 0 To 6
Text1(i).Enabled = False
Next
End Sub
Private Sub FillTextUp()
Dim i As Integer
For i = 0 To 6
Add(i) = Text1(i)
Next
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -