📄 main_jbzl_jsr.frm
字号:
Caption = "取消"
Key = "cancel"
ImageIndex = 5
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "查找"
Key = "find"
ImageIndex = 6
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
EndProperty
BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
EndProperty
BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Style = 3
EndProperty
BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "关闭"
Key = "close"
ImageIndex = 7
EndProperty
EndProperty
BorderStyle = 1
End
Begin VB.Frame Frame1
Height = 2055
Left = 15
TabIndex = 1
Top = 765
Width = 8175
Begin MSComCtl2.DTPicker DTPicker2
Height = 330
Left = 5040
TabIndex = 24
Top = 1635
Width = 3060
_ExtentX = 5398
_ExtentY = 582
_Version = 393216
Format = 19791873
CurrentDate = 38695
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 330
Left = 1050
TabIndex = 22
Top = 1620
Width = 3060
_ExtentX = 5398
_ExtentY = 582
_Version = 393216
Format = 19791873
CurrentDate = 38695
End
Begin VB.CheckBox Check1
Caption = "是"
Height = 180
Left = 1080
TabIndex = 19
Top = 1335
Width = 480
End
Begin VB.ComboBox Combo2
Height = 300
Left = 5325
TabIndex = 17
Text = "Combo1"
Top = 930
Width = 2775
End
Begin VB.ComboBox Combo1
Height = 300
Left = 5325
TabIndex = 15
Text = "Combo1"
Top = 555
Width = 2775
End
Begin VB.TextBox Text1
Height = 330
Index = 4
Left = 2340
Locked = -1 'True
TabIndex = 12
Top = 1245
Width = 2055
End
Begin VB.TextBox Text1
Height = 330
Index = 5
Left = 5325
Locked = -1 'True
TabIndex = 11
Top = 1260
Width = 2775
End
Begin VB.TextBox Text1
Height = 330
Index = 3
Left = 915
Locked = -1 'True
TabIndex = 8
Top = 885
Width = 3480
End
Begin VB.TextBox Text1
Height = 330
Index = 2
Left = 915
Locked = -1 'True
TabIndex = 7
Top = 525
Width = 3480
End
Begin VB.TextBox Text1
Height = 330
Index = 1
Left = 3300
Locked = -1 'True
TabIndex = 4
Top = 150
Width = 4815
End
Begin VB.TextBox Text1
Height = 330
Index = 0
Left = 915
Locked = -1 'True
TabIndex = 3
Top = 150
Width = 1530
End
Begin VB.Label Label11
Caption = "结束时间"
Height = 195
Left = 4230
TabIndex = 23
Top = 1710
Width = 765
End
Begin VB.Label Label10
Caption = "开课时间"
Height = 195
Left = 165
TabIndex = 21
Top = 1695
Width = 765
End
Begin VB.Label Label9
Caption = "费用"
Height = 165
Left = 4860
TabIndex = 20
Top = 1365
Width = 360
End
Begin VB.Label Label8
Caption = "是否认证"
Height = 225
Left = 120
TabIndex = 18
Top = 1335
Width = 795
End
Begin VB.Label Label7
Caption = "授课方式"
Height = 165
Left = 4485
TabIndex = 16
Top = 960
Width = 735
End
Begin VB.Label Label6
Caption = "授课对象"
Height = 165
Left = 120
TabIndex = 14
Top = 990
Width = 750
End
Begin VB.Label Label5
Caption = "时数"
Height = 165
Left = 1890
TabIndex = 13
Top = 1350
Width = 465
End
Begin VB.Label Label4
Caption = "主办单位"
Height = 165
Left = 105
TabIndex = 10
Top = 600
Width = 795
End
Begin VB.Label Label3
Caption = "培训方式"
Height = 165
Left = 4515
TabIndex = 9
Top = 585
Width = 735
End
Begin VB.Label Label2
Caption = "课程名称"
ForeColor = &H000000FF&
Height = 165
Left = 2520
TabIndex = 6
Top = 225
Width = 975
End
Begin VB.Label Label1
Caption = "课程编号"
ForeColor = &H000000FF&
Height = 165
Left = 120
TabIndex = 2
Top = 240
Width = 945
End
End
End
Attribute VB_Name = "main_jbzl_jsr"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs1 As New ADODB.Recordset
Public blnAdd As Boolean
Dim mybookmark
Sub view_data()
Dim i As Integer
If Adodc1.Recordset.RecordCount > 0 Then
For i = 0 To Text1.UBound
Text1(i) = DataGrid1.Columns(i).text
Next i
End If
End Sub
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
view_data
End Sub
Private Sub Form_Activate()
If sql <> "" Then
Adodc1.RecordSource = sql
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
view_data
Else
MsgBox "没有找到符合条件的记录!", , "提示窗口"
End If
End If
End Sub
Private Sub Form_Load()
Me.Caption = text
tlbState Toolbar1, False
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
sql = ""
End Sub
Private Sub Text1_GotFocus(Index As Integer)
Text1(Index).BackColor = &HFFFF00
Text1(Index).SelStart = 0
Text1(Index).SelLength = Len(Text1(Index))
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn And Index < 5 Then Text1(Index + 1).SetFocus
End Sub
Private Sub Text1_LostFocus(Index As Integer)
Text1(Index).BackColor = &H80000005
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "add"
blnAdd = True
tlbState Toolbar1, True
rs1.Open "select * from tb_jsr", Cnn, adOpenStatic
If rs1.RecordCount > 0 Then
rs1.MoveLast
Text1(0) = Format(Val(rs1.Fields("课程编号")) + 1, "00")
Else
Text1(0) = "01"
End If
rs1.Close
For i = 1 To Text1.UBound
Text1(i) = ""
Text1(i).Locked = False
Next i
Text1(1).SetFocus
Case "modify"
If Adodc1.Recordset.RecordCount > 0 Then
blnAdd = False
tlbState Toolbar1, True
For i = 1 To Text1.UBound
Text1(i).Locked = False
Next i
view_data
mybookmark = DataGrid1.Bookmark
Else
MsgBox "系统没有要修改的数据!", , "提示窗口"
End If
Case "delete"
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.Delete
Adodc1.Refresh
Else
MsgBox "系统没有要删除的数据!", , "提示窗口"
End If
Case "save"
On Error GoTo SaveErr
If Text1(0).text = "" Then
MsgBox "系统不允许" & Label1 & "为空!", , "提示窗口"
Exit Sub
End If
If blnAdd = True Then
Cnn.Execute ("insert into 培训课程表(课程编号,课程名称,主办单位,培训方式,授课对象,授课方式,是否认证,授课时数,费用,开课时间,结束时间) values('" + Text1(0) + _
"','" + Text1(1) + "','" + Text1(2) + "','" + Combo1 + "','" + Text1(3) + "','" + combo4 + "','" + Check1.Value + "'," + Text1(4) + ",'" + Str(DTPicker1) + "','" + Str(DTPicker2) + "')")
Adodc1.Refresh
tlbState Toolbar1, False
For i = 1 To Text1.UBound
Text1(i).Locked = True
Next i
Else
Cnn.Execute ("update tb_jsr set 经手人姓名 ='" + Text1(1) + "',联系方式 ='" + Text1(2) + _
"',联系地址 ='" + Text1(3) + "',身份证号 ='" + Text1(4) + "',备注='" + Text1(5) + _
"',修改人='" + czy + "',修改日期='" + Str(Date) + "'where 经手人编号='" + DataGrid1.Columns(0) + "'")
Adodc1.Refresh
DataGrid1.Bookmark = mybookmark
view_data
tlbState Toolbar1, False
For i = 1 To Text1.UBound
Text1(i).Locked = True
Next i
End If
Exit Sub
SaveErr:
MsgBox Err.Description
Case "cancel"
tlbState Toolbar1, False
For i = 1 To Text1.UBound
Text1(i).Locked = True
Next i
Case "find"
tb = "tb_jsr"
Load main_find
main_find.Show 1
Case "close"
Unload Me
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -