📄 frmdelete.frm
字号:
VERSION 5.00
Begin VB.Form frmDelete
AutoRedraw = -1 'True
BorderStyle = 3 'Fixed Dialog
Caption = "删除记录"
ClientHeight = 1560
ClientLeft = 45
ClientTop = 330
ClientWidth = 4410
Icon = "frmDelete.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 1560
ScaleWidth = 4410
ShowInTaskbar = 0 'False
Begin VB.Frame Frame1
Caption = "请输入要删除的样品全称"
ForeColor = &H00008000&
Height = 1035
Left = 225
TabIndex = 2
Top = 255
Width = 3960
Begin VB.TextBox Text1
BeginProperty Font
Name = "黑体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00008000&
Height = 435
Left = 225
MaxLength = 25
TabIndex = 0
Top = 390
Width = 2235
End
Begin VB.CommandButton Command1
Caption = "删除(&D)"
Enabled = 0 'False
Height = 450
Left = 2610
TabIndex = 1
Top = 375
Width = 1170
End
End
End
Attribute VB_Name = "frmDelete"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim DB As Database, EF As Recordset, Tempstr As String
Set DB = OpenDatabase(SampleData)
Set EF = DB.OpenRecordset("S_Main", dbOpenDynaset)
Tempstr = "样品名称='" & Text1.Text & "'"
EF.FindFirst Tempstr
If EF.NoMatch Then
MsgBox "您输入的样品名称不存在,请检查后,再试试!", vbOKOnly + 48, "警告!"
DB.Close
Text1.SetFocus
Exit Sub
Else
DB.Close
ModifyText = Trim(Text1.Text)
'进行下一步
Unload Me
End If
End Sub
Private Sub Form_Load()
frmDelete.HelpContextID = 3
Me.Left = (MDIForm1.Width - Me.Width) / 2 + 100
Me.Top = (MDIForm1.Height - Me.Height) / 2 - 300 - 1500
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = 1 Then
frmPDelete.Show
End If
End Sub
Private Sub Text1_Change()
If Trim(Text1.Text) = "" Then
Command1.Enabled = False
Else
Command1.Enabled = True
End If
End Sub
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Trim(Text1.Text) <> "" Then
SendKeys "{tab}"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -