📄
字号:
VERSION 5.00
Begin VB.Form 编辑信息1
BorderStyle = 1 'Fixed Single
Caption = "记录编辑"
ClientHeight = 1920
ClientLeft = 45
ClientTop = 435
ClientWidth = 4530
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1920
ScaleWidth = 4530
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Caption = "记录编辑"
Height = 1575
Left = 120
TabIndex = 0
Top = 120
Width = 4215
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2520
TabIndex = 4
Top = 960
Width = 855
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 720
TabIndex = 3
Top = 960
Width = 855
End
Begin VB.TextBox Text1
Height = 270
Left = 1200
TabIndex = 2
Text = "Text1"
Top = 360
Width = 2655
End
Begin VB.Label Label1
Caption = "Label1"
Height = 255
Left = 360
TabIndex = 1
Top = 360
Width = 615
End
End
End
Attribute VB_Name = "编辑信息1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click() '确定
Dim sqltxt As String
If Trim(Text1.Text) = "" Then
MsgBox "数据项不能为空,请重新设置", vbOKOnly, "信息提示"
Text1.SetFocus
Exit Sub
End If
sqltxt = "select * from press where fn='" + Trim(Text1.Text) + "'"
Set brs = exesql(sqltxt)
If flag = 1 Then '添加操作,先判断是否存在相同的记录
If brs.RecordCount <> 0 Then '原记录个数大于0
MsgBox "存在相同的记录", vbOKOnly, "信息提示"
Text1.SetFocus
brs.Close
Exit Sub
End If
brs.AddNew
brs.Fields("fn") = Trim(Text1.Text)
brs.Update
Text1.Text = ""
recs = recs + 1
Else '修改操作
brs.Fields("fn") = Trim(Text1.Text)
brs.Update
End If
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Label1.Caption = cap
If flag = 1 Then
Text1.Text = ""
Else
Text1.Text = press1
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -