📄 add.frm
字号:
Height = 855
Left = 360
TabIndex = 13
Top = 3540
Width = 1815
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "摘要"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 360
TabIndex = 12
Top = 2520
Width = 1815
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "期刊"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 360
TabIndex = 11
Top = 4560
Width = 2055
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "所属类别"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 360
TabIndex = 10
Top = 5580
Width = 2055
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "存储位置"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 360
TabIndex = 9
Top = 6600
Width = 2055
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim panduan As Boolean
Dim i As Integer, j As Integer, x As Integer
Dim konghao As String
Dim find As Boolean
Private Sub Command1_Click()
If Text1.Text = "" Or Combo1.Text = "" Or Text7.Text = "" Then
ret = MsgBox("论文题目、所属类别与存储路径不能为空!", vbOKOnly, "错误提示!")
Text1.SetFocus
GoTo error
End If
Call panduanid
If panduan = True Then
Call generatenum
Form4.Data1.Recordset.AddNew
Form4.Data1.Recordset.Fields("id") = konghao
Form4.Data1.Recordset.Fields("name") = Text1.Text
Form4.Data1.Recordset.Fields("author") = Text2.Text
Form4.Data1.Recordset.Fields("abstract") = Text3.Text
Form4.Data1.Recordset.Fields("keyword") = Text4.Text
Form4.Data1.Recordset.Fields("journal") = Text5.Text
Form4.Data1.Recordset.Fields("catagory") = Combo1.Text
Form4.Data1.Recordset.Fields("path") = Text7.Text
Form4.Data1.UpdateRecord
Form4.Data1.Recordset.MoveFirst
counter = counter + 1
Form4.Data1.Refresh
Command2.Enabled = True
Command1.Enabled = False
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Combo1.Enabled = False
Text7.Enabled = False
End If
Command4.Enabled = False
error:
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text7.Text = ""
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Combo1.Enabled = True
Text7.Enabled = True
Command1.Enabled = True
Command2.Enabled = False
Command4.Enabled = True
End Sub
Private Sub Command3_Click()
If Form4.Data1.Recordset.EOF = True Then
Form4.Data1.Recordset.MoveLast
End If
num = 1
Form4.Data1.Refresh
If counter = 1 Or counter = 0 Then
Form4.Command6.Enabled = False
Form4.Command7.Enabled = False
Form4.Command8.Enabled = False
Form4.Command9.Enabled = False
Else
Form4.Command6.Enabled = False
Form4.Command7.Enabled = False
Form4.Command8.Enabled = True
Form4.Command9.Enabled = True
End If
Unload Me
Form4.Show
Call lab
End Sub
Private Sub Command4_Click()
CommonDialog1.ShowOpen
Text7.Text = CommonDialog1.FileName
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text7.Text = ""
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text7.Enabled = True
Command2.Enabled = False
Form4.Data2.DatabaseName = "D:\managepaperluojia\databasemanage\key.mdb"
Form4.Data2.RecordSource = "catalogue"
Form4.Data2.Refresh
Form4.Data2.Recordset.MoveFirst
treecounter = 0
Do While Form4.Data2.Recordset.EOF = False
treecounter = treecounter + 1
Combo1.AddItem Form4.Data2.Recordset.Fields("treename")
Form4.Data2.Recordset.Edit
Form4.Data2.Recordset.Update
Form4.Data2.Recordset.MoveNext
Loop
Form4.Data2.Recordset.MoveFirst
End Sub
Private Sub panduanid()
panduan = True
Form4.Data1.Recordset.MoveFirst
Do While panduan = True And Form4.Data1.Recordset.EOF = False
If (Form4.Data1.Recordset.Fields("name") = Text1.Text) Then
panduan = False
End If
Form4.Data1.Recordset.MoveNext
Loop
If Form4.Data1.Recordset.EOF = True Then Form4.Data1.Recordset.MovePrevious
If panduan = False Then
MsgBox "论文题目有重复!请重新输入!", 0 + 48, "输入错误!"
Text1.SetFocus
End If
End Sub
Private Sub generatenum()
find = False '表示没有找到空号码
Form4.Data1.Refresh
Form4.Data1.Recordset.MoveFirst
konghao = "10000001"
Do While Form4.Data1.Recordset.EOF = False
If konghao = Form4.Data1.Recordset.Fields("id") Then
Form4.Data1.Recordset.MoveNext
konghao = Trim(Str$(konghao + 1))
Else
find = True '找到空号码,号码值为当前konghao的值
Exit Do
End If
Loop
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -