📄 frm_hyjl.frm
字号:
Caption = "删除"
Key = "Del"
ImageIndex = 2
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "修改"
Key = "Edit"
ImageIndex = 3
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "保存"
Key = "Save"
ImageIndex = 4
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "取消"
Key = "Cancel"
ImageIndex = 5
EndProperty
BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退出"
Key = "Exit"
ImageIndex = 6
EndProperty
BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
EndProperty
BorderStyle = 1
End
Begin VB.Label Label11
Caption = "备注"
Height = 270
Left = 195
TabIndex = 15
Top = 3900
Width = 975
End
Begin VB.Label Label10
Caption = "主题词"
Height = 225
Left = 195
TabIndex = 14
Top = 3540
Width = 735
End
Begin VB.Label Label9
Caption = "会议记录"
Height = 360
Left = 195
TabIndex = 13
Top = 3150
Width = 1140
End
Begin VB.Label Label8
Caption = "记录人"
Height = 285
Left = 195
TabIndex = 12
Top = 2775
Width = 780
End
Begin VB.Label Label7
Caption = "主持人"
Height = 270
Left = 195
TabIndex = 11
Top = 2385
Width = 840
End
Begin VB.Line Line2
BorderColor = &H00008000&
X1 = 630
X2 = 6765
Y1 = 4425
Y2 = 4425
End
Begin VB.Label Label6
Caption = "地点"
Height = 270
Left = 195
TabIndex = 8
Top = 2010
Width = 885
End
Begin VB.Label Label5
Caption = "时间"
Height = 315
Left = 195
TabIndex = 7
Top = 1665
Width = 930
End
Begin VB.Label Label4
Caption = "会议主题"
Height = 240
Left = 195
TabIndex = 6
Top = 1290
Width = 1290
End
Begin VB.Label Label3
Caption = "编号"
Height = 210
Left = 195
TabIndex = 5
Top = 960
Width = 585
End
Begin VB.Label Label2
Caption = "记录修改人"
Height = 255
Left = 4740
TabIndex = 3
Top = 4650
Width = 960
End
Begin VB.Label Label1
Caption = "记录修改日期"
Height = 225
Left = 1830
TabIndex = 1
Top = 4665
Width = 1140
End
Begin VB.Line Line1
BorderColor = &H00008000&
X1 = 630
X2 = 6765
Y1 = 4395
Y2 = 4395
End
End
Attribute VB_Name = "frm_hyjl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Dim c
Private Sub Cmd_Select_Click()
frm_T_Hys.Show 1
End Sub
Private Sub Dgr_Sjll_Click()
On Error Resume Next
If Adodc2.Recordset.RecordCount > 0 Then
Text1(0).Text = Adodc2.Recordset.Fields(0)
Text1(1).Text = Adodc2.Recordset.Fields(1)
Text1(2).Text = Adodc2.Recordset.Fields(3)
Text1(3).Text = Adodc2.Recordset.Fields(4)
DT1.Value = Adodc2.Recordset.Fields(2)
Text1(4).Text = Adodc2.Recordset.Fields(5)
Text1(5).Text = Adodc2.Recordset.Fields(6)
Text1(6).Text = Adodc2.Recordset.Fields(7)
Text1(7).Text = Adodc2.Recordset.Fields(8)
Txt_Date.Text = Adodc2.Recordset.Fields(9)
Txt_lxr.Text = Adodc2.Recordset.Fields(10)
End If
For i = 0 To 7
Text1(i).Locked = False
Next i
End Sub
Private Sub DT1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text1(2).SetFocus
End If
End Sub
Private Sub Form_Load()
DT1.Value = Date '使日期控件中显示当前系统的日期时间
Call LoadFile '调用事件过程,在窗体文本框中显示数据
For i = 1 To 7
Text1(i).Locked = True
Next i
Adodc2.ConnectionString = PublicStr '连接数据库
Adodc2.RecordSource = "select * from 会议记录 order by 编号"
Adodc2.Refresh
Call DBGCon
Call Tbr_cortrol(Tbr_xxcz, True)
End Sub
Private Sub Tbr_xxcz_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "Add"
Call Tbr_cortrol(Tbr_xxcz, False)
For i = 0 To 7
Text1(i).Locked = False
Text1(i).Text = ""
Text1(0).SetFocus
Next i
AdoRs.Open "select * from 会议记录 order by 编号", Cnn, adOpenKeyset
If AdoRs.RecordCount > 0 Then
AdoRs.MoveLast
StrNum = Mid(AdoRs.Fields("编号"), 2, Len(AdoRs.Fields("编号")))
Call Con_PublicNum '调用位数转换函数
Text1(0).Text = "C" & StrIn
Else
Text1(0).Text = "C0001"
End If
AdoRs.Close
DT1.Value = Date
Case "Del" '删除信息
Call Deletes
Call DBGCon
Case "Edit" '修改信息
Call Edits
Call DBGCon
Case "Save" '保存信息
Call Saves
Call DBGCon
Case "Cancel"
Call Tbr_cortrol(Tbr_xxcz, True)
For i = 1 To 3
Text1(i).Text = ""
Text1(1).SetFocus
Text1(i).Locked = True
Next i
Adodc2.RecordSource = "select * from 会议记录 order by 编号"
Adodc2.Refresh
Call DBGCon
Case "Exit"
Unload Me
End Select
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
On Error Resume Next
If KeyCode = 13 Then
If Index = 1 Then
DT1.SetFocus
Exit Sub
ElseIf Index = 2 Then
Call Cmd_Select_Click
Exit Sub
End If
End If
If Index < 8 And KeyCode = 38 Then Text1(Index - 1).SetFocus
If Index >= 0 And KeyCode = 40 Then Text1(Index + 1).SetFocus
If Index >= 0 And KeyCode = 13 Then Text1(Index + 1).SetFocus
If Index = 7 And KeyCode = 13 Then
Call Saves
End If
End Sub
Private Sub Saves() '保存信息的事件过程
If Text1(0).Text = "" Or Text1(1).Text = "" Or Text1(4).Text = "" Or Text1(5).Text = "" Then
MsgBox "重要信息不能为空值", 48, "提示信息"
Else
AdoRs.Open "select * from 会议记录 where 会议主题='" + Text1(1).Text + "'", Cnn, adOpenKeyset
If AdoRs.RecordCount > 0 Then
MsgBox "该信息已经存在", 48, "提示信息"
AdoRs.Close
Else
AdoRs.Close
c = MsgBox("确认保存信息吗?", 33, "提示信息")
If c = vbOK Then
Set AdoRs = Cnn.Execute("insert into 会议记录 values('" & Text1(0) _
& "','" & Text1(1) & "','" & STR(DT1.Value) & "','" & Text1(2) & "','" _
& Text1(3) & "','" & Text1(4) & "','" & Text1(5) & "','" & Text1(6) & "','" & Text1(7) & "',' ',' ')")
MsgBox "数据保存成功", 64, "提示信息"
Adodc2.RecordSource = "select * from 会议记录 order by 编号"
Adodc2.Refresh
Else
End If
End If
Call Tbr_cortrol(Tbr_xxcz, True)
End If
End Sub
Private Sub Edits() '修改信息的事件过程
c = MsgBox("确认修改信息吗?", 33, "提示信息")
If c = vbOK Then
Set AdoRs = Cnn.Execute("UPDATE 会议记录 SET 编号='" + Text1(0) + "',会议主题='" + Text1(1) + "',时间='" + STR(DT1.Value) + "',地点='" _
+ Text1(2) + "',主持人='" + Text1(3) + "',记录人='" + Text1(4) + "',会议记录='" + Text1(5) + "',主题词='" + Text1(6) + "',备注='" + Text1(7) _
+ "',记录修改日期='" + STR(Date) + "',记录修改人='" + Name1 + "' where 编号='" + Text1(0).Text + "'")
MsgBox "数据修改成功", 64, "提示信息"
Adodc2.RecordSource = "select * from 会议记录 order by 编号"
Adodc2.Refresh
StrId = Text1(0).Text
StrTitle = Text1(1).Text
Call joinRZ
Call DBGCon
Else
End If
End Sub
Private Sub LoadFile()
On Error Resume Next
AdoRs.Open "select * from 会议记录", Cnn, adOpenKeyset
If AdoRs.RecordCount > 0 Then
Text1(0).Text = AdoRs.Fields(0)
Text1(1).Text = AdoRs.Fields(1)
Text1(2).Text = AdoRs.Fields(3)
Text1(3).Text = AdoRs.Fields(4)
DT1.Value = AdoRs.Fields(2)
Text1(4).Text = AdoRs.Fields(5)
Text1(5).Text = AdoRs.Fields(6)
Text1(6).Text = AdoRs.Fields(7)
Text1(7).Text = AdoRs.Fields(8)
Txt_Date.Text = AdoRs.Fields(9)
Txt_lxr.Text = AdoRs.Fields(10)
End If
AdoRs.Close
End Sub
Private Sub Deletes() '删除信息
c = MsgBox("确认删除该信息吗?", 17, "提示信息")
If c = vbOK Then
Set AdoRs = Cnn.Execute("Delete 会议记录 from 会议记录 where 编号='" + Text1(0).Text + "'")
Adodc2.RecordSource = "select * from 会议记录 order by 编号"
Adodc2.Refresh
End If
For i = 0 To 7
Text1(i).Text = ""
Next i
End Sub
Private Sub DBGCon()
Dgr_Sjll.Columns(0).Caption = "编号"
Dgr_Sjll.Columns(1).Caption = "会议主题"
Dgr_Sjll.Columns(2).Caption = "时间"
Dgr_Sjll.Columns(3).Caption = "地点"
Dgr_Sjll.Columns(4).Caption = "主持人"
Dgr_Sjll.Columns(5).Caption = "记录人"
Dgr_Sjll.Columns(6).Caption = "会议记录"
Dgr_Sjll.Columns(7).Caption = "主题词"
Dgr_Sjll.Columns(8).Caption = "备注"
Dgr_Sjll.Columns(9).Caption = "记录修改时间"
Dgr_Sjll.Columns(10).Caption = "记录修改人"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -