📄 word_in.frm
字号:
VERSION 5.00
Begin VB.Form word_in
Caption = "单词输入"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.ComboBox Cob
Height = 300
Left = 1800
TabIndex = 7
Text = "Combo1"
Top = 1560
Width = 2055
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2520
TabIndex = 6
Top = 2520
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "确认"
Height = 375
Left = 480
TabIndex = 5
Top = 2520
Width = 1575
End
Begin VB.TextBox Text2
Height = 375
Left = 1800
TabIndex = 4
Top = 960
Width = 2055
End
Begin VB.TextBox Text1
Height = 375
Left = 1800
TabIndex = 3
Top = 360
Width = 2055
End
Begin VB.Label Label3
Caption = "级别"
Height = 255
Left = 840
TabIndex = 2
Top = 1680
Width = 735
End
Begin VB.Label Label2
Caption = "翻译"
Height = 255
Left = 840
TabIndex = 1
Top = 1080
Width = 735
End
Begin VB.Label Label1
Caption = "单词"
Height = 255
Left = 840
TabIndex = 0
Top = 480
Width = 855
End
End
Attribute VB_Name = "word_in"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As DAO.Database
Dim rec As DAO.Recordset
Private Sub Command1_Click()
If Text1.Text <> "" And Text2.Text <> "" Then
rec.MoveFirst
Do While Not rec.EOF
word_no = rec!单词号
If rec!单词 = Trim(Text1.Text) Then
Exit Do
Else
rec.MoveNext
End If
Loop
If rec.EOF Then
rec.AddNew
rec!单词号 = word_no + 1
rec!单词 = Text1.Text
rec!翻译 = Text2.Text
rec!级别 = Cob.Text
rec.Update
Else
If MsgBox("该单词已经存在,要覆盖吗?", vbYesNo) = vbYes Then
rec.Edit
rec!翻译 = Text2.Text
rec!级别 = Cob.Text
rec.Update
End If
End If
MsgBox ("单词已经输入")
Else
MsgBox ("单词输入不能有空")
End If
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Set db = OpenDatabase(App.Path & "\sourse.mdb")
Set rec = db.OpenRecordset("word")
Cob.AddItem "初级", 0
Cob.AddItem "中级", 1
Cob.AddItem "高级", 2
Cob.ListIndex = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
word.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -