📄 main_yxzy_grmlgl_lr.frm
字号:
VERSION 5.00
Begin VB.Form main_yxzy_grmlgl_lr
BorderStyle = 3 'Fixed Dialog
Caption = "Form1"
ClientHeight = 2550
ClientLeft = 45
ClientTop = 330
ClientWidth = 6075
Icon = "main_yxzy_grmlgl_lr.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2550
ScaleWidth = 6075
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command1
Caption = "确定"
Height = 390
Left = 1200
TabIndex = 12
Top = 2070
Width = 1770
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 390
Left = 3090
TabIndex = 11
Top = 2070
Width = 1770
End
Begin VB.Frame Frame1
Height = 2040
Left = 30
TabIndex = 0
Top = -60
Width = 6045
Begin VB.TextBox Text1
Height = 330
Index = 6
Left = 810
TabIndex = 17
Top = 1605
Width = 5145
End
Begin VB.TextBox txtID
Height = 330
Left = 4110
TabIndex = 16
Top = 165
Visible = 0 'False
Width = 1875
End
Begin VB.TextBox Text1
Height = 330
Index = 5
Left = 3615
TabIndex = 13
Top = 1245
Width = 2355
End
Begin VB.TextBox Text1
Height = 330
Index = 1
Left = 810
TabIndex = 5
Top = 525
Width = 1125
End
Begin VB.TextBox Text1
Height = 330
Index = 2
Left = 2460
TabIndex = 4
Top = 525
Width = 3525
End
Begin VB.TextBox Text1
Height = 330
Index = 3
Left = 810
TabIndex = 3
Top = 885
Width = 5145
End
Begin VB.TextBox Text1
Height = 330
Index = 0
Left = 810
TabIndex = 2
Top = 165
Width = 2865
End
Begin VB.TextBox Text1
Height = 330
Index = 4
Left = 810
TabIndex = 1
Top = 1245
Width = 2340
End
Begin VB.Label Label5
Caption = "手机"
Height = 165
Left = 405
TabIndex = 18
Top = 1710
Width = 795
End
Begin VB.Label lblID
BackStyle = 0 'Transparent
Caption = "ID"
Height = 180
Left = 3795
TabIndex = 15
Top = 240
Visible = 0 'False
Width = 225
End
Begin VB.Label Label3
Caption = "电话"
Height = 165
Left = 3210
TabIndex = 14
Top = 1335
Width = 795
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "公司名称"
ForeColor = &H000000FF&
Height = 165
Left = 75
TabIndex = 10
Top = 240
Width = 735
End
Begin VB.Label Label2
Caption = "姓名"
ForeColor = &H000000FF&
Height = 165
Left = 420
TabIndex = 9
Top = 600
Width = 390
End
Begin VB.Label Label4
Caption = "职务"
Height = 165
Left = 2025
TabIndex = 8
Top = 630
Width = 405
End
Begin VB.Label Label8
Caption = "地址"
Height = 165
Left = 420
TabIndex = 7
Top = 975
Width = 795
End
Begin VB.Label Label6
Caption = "邮编"
Height = 165
Left = 390
TabIndex = 6
Top = 1350
Width = 735
End
End
End
Attribute VB_Name = "main_yxzy_grmlgl_lr"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs1 As New ADODB.Recordset
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Text1(0).SetFocus
End Sub
Private Sub Form_Load()
If blnAddGRML = True Then
Me.Caption = "个人信息添加"
For i = 1 To Text1.UBound
Text1(i) = ""
Next i
Else
Me.Caption = "个人信息修改"
With main_yxzy_grmlgl.Adodc1.Recordset
lblID.Visible = True
txtID.Visible = True
txtID.text = .Fields("ID")
For i = 0 To Text1.UBound
Text1(i) = .Fields(i + 1)
Next i
End With
End If
End Sub
Private Sub Text1_GotFocus(Index As Integer)
Text1(Index).BackColor = &HFFFF00
Text1(Index).SelStart = 0
Text1(Index).SelLength = Len(Text1(Index))
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn And Index < 6 Then Text1(Index + 1).SetFocus
If KeyCode = vbKeyReturn And Index = 6 Then Command1.SetFocus
End Sub
Private Sub Text1_LostFocus(Index As Integer)
Text1(Index).BackColor = &H80000005
End Sub
Private Sub Command1_Click()
On Error GoTo SaveErr
If blnAddGRML = True Then
Cnn.Execute ("insert into 个人名录表 values('" + Text1(0) + "','" + Text1(1) + "','" + Text1(2) + _
"','" + Text1(3) + "','" + Text1(4) + "','" + Text1(5) + "','" + Text1(6) + "')")
Else
Cnn.Execute ("update 个人名录表 set 公司名称='" + Text1(0) + "',姓名='" + Text1(1) + "',职务='" + Text1(2) + _
"',地址='" + Text1(3) + "',邮编='" + Text1(4) + "',电话='" + Text1(5) + "',手机='" + Text1(6) + _
"'where ID =" + txtID + "")
End If
main_yxzy_grmlgl.Adodc1.Refresh
If GRMLBookmark <> "" Then main_yxzy_grmlgl.DataGrid1.Bookmark = GRMLBookmark
Unload Me
Exit Sub
SaveErr:
MsgBox Err.Description
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -