📄 frmpublishload.frm
字号:
VERSION 5.00
Begin VB.Form Frmpublishload
Caption = "杂志"
ClientHeight = 3120
ClientLeft = 60
ClientTop = 345
ClientWidth = 4695
Icon = "Frmpublishload.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
ScaleHeight = 3120
ScaleWidth = 4695
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Cmdadd
Caption = "添加(&A)"
Height = 375
Left = 1800
TabIndex = 7
Top = 2640
Width = 975
End
Begin VB.Frame Frame1
Height = 2295
Left = 240
TabIndex = 3
Top = 120
Width = 4335
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "Arial"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 390
Left = 1320
TabIndex = 9
Top = 1440
Width = 1215
End
Begin VB.TextBox Txtname
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 390
Left = 1320
TabIndex = 6
Top = 960
Width = 2775
End
Begin VB.TextBox Txtcode
BeginProperty Font
Name = "Arial"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 390
Left = 1320
TabIndex = 0
Top = 480
Width = 1575
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "杂志类型"
BeginProperty Font
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 2
Left = 240
TabIndex = 8
Top = 1560
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "杂志名称"
BeginProperty Font
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 3
Left = 240
TabIndex = 5
Top = 1080
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "邮发代号"
BeginProperty Font
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 1
Left = 240
TabIndex = 4
Top = 600
Width = 900
End
End
Begin VB.CommandButton Cmdno
Caption = " 取消(&C)"
Height = 375
Left = 2640
TabIndex = 1
Top = 2640
Visible = 0 'False
Width = 975
End
Begin VB.CommandButton Cmdyes
Caption = " 确定(&Q)"
Height = 375
Left = 960
TabIndex = 2
Top = 2640
Visible = 0 'False
Width = 975
End
End
Attribute VB_Name = "Frmpublishload"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmdadd_Click() '//y
Me.Frame1.Enabled = True
Me.Txtcode.Text = ""
Me.Cmdadd.Visible = False
Me.Cmdyes.Visible = True
Me.Cmdno.Visible = True
Me.Txtcode.SetFocus
End Sub
Private Sub Cmdno_Click()
Unload Me
End Sub
Private Sub Cmdyes_Click() '//y
Dim s As String
If Me.Txtcode.Text = "" Then
MsgBox "请输入邮发代号!", vbExclamation, "杂志"
Exit Sub
End If
If Me.Txtname.Text = "" Then
MsgBox "请输入杂志名称!", vbExclamation, "杂志"
Exit Sub
End If
If Me.Combo1.Text = "" Then
MsgBox "请选择杂志类别!", vbExclamation, "杂志"
Exit Sub
End If
'Download by http://www.codefans.net
'//若没有重复则进行添加
With Frmpublishmodify.Adodc1 '//y
If Me.Caption = "杂志" Then
'//检验唯一性
sql = "select * from magazine where code='" & Trim(Me.Txtcode.Text) & "'"
.CommandType = adCmdText
.RecordSource = sql
.Refresh
.CommandType = adCmdTable
If .Recordset.RecordCount <> 0 Then
MsgBox "邮发代号重复!", vbExclamation, "杂志录入"
Me.Txtcode.SetFocus
Exit Sub
End If
.Recordset.AddNew
.Recordset.Fields(0).Value = Trim(Me.Txtcode.Text)
.Recordset.Fields(1).Value = Trim(Me.Txtname.Text)
.Recordset.Fields(2).Value = Trim(Me.Combo1.Text)
.Recordset.Update
Me.Cmdadd.Visible = True
Me.Cmdyes.Visible = False
Me.Cmdno.Visible = False
Else
'.Fields(0).Value = Trim(Me.Txtname.Text)
.Recordset.Fields(1).Value = Trim(Me.Txtname.Text)
.Recordset.Fields(2).Value = Trim(Me.Combo1.Text)
.Recordset.Update
Me.Caption = "杂志"
Unload Me
MsgBox "该杂志信息修改成功!", vbExclamation, "修改"
End If
End With
Me.Frame1.Enabled = False
End Sub
Private Sub Form_Load()
Me.Txtcode.Text = ""
Me.Txtname.Text = ""
Me.Combo1.AddItem "月刊"
Me.Combo1.AddItem "半月刊"
Me.Combo1.AddItem "季刊"
Me.Combo1.AddItem "半年"
Me.Combo1.AddItem "全年"
Me.Cmdadd.Visible = False
Me.Cmdyes.Visible = True
Me.Cmdno.Visible = True
Me.Combo1.ListIndex = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
Frmpublishmodify.Adodc1.CommandType = adCmdText
Frmpublishmodify.Adodc1.RecordSource = "select * from magazine order by code"
Frmpublishmodify.Adodc1.Refresh
Frmpublishmodify.Adodc1.CommandType = adCmdTable
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -