📄 frm_sjss3.frm
字号:
VERSION 5.00
Begin VB.Form frm_sjss3
Caption = "试卷资料修改"
ClientHeight = 5505
ClientLeft = 3345
ClientTop = 3405
ClientWidth = 8925
Icon = "frm_sjss3.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 5505
ScaleWidth = 8925
WindowState = 2 'Maximized
Begin VB.CommandButton Command2
Caption = "保存修改(&S)"
Default = -1 'True
Height = 495
Left = 5160
TabIndex = 17
Top = 4680
Width = 1575
End
Begin VB.CommandButton Command1
Cancel = -1 'True
Caption = "取消修改(&C)"
Height = 495
Left = 2160
TabIndex = 16
Top = 4680
Width = 1695
End
Begin VB.Frame Frame1
Caption = "试卷基本资料修改"
Height = 4095
Left = 1080
TabIndex = 0
Top = 240
Width = 6495
Begin VB.ComboBox cmb_institute
Height = 300
ItemData = "frm_sjss3.frx":030A
Left = 4200
List = "frm_sjss3.frx":030C
TabIndex = 23
Top = 840
Width = 1815
End
Begin VB.ComboBox cmb_teacher
Height = 300
Left = 4200
TabIndex = 22
Text = "Combo2"
Top = 1320
Width = 1815
End
Begin VB.ComboBox cmb_course
Height = 300
Left = 4200
TabIndex = 21
Text = "Combo3"
Top = 1800
Width = 1815
End
Begin VB.ComboBox cmb_classes
Height = 300
Left = 4200
TabIndex = 20
Text = "Combo4"
Top = 2280
Width = 1815
End
Begin VB.ComboBox cmb_year
Height = 300
Left = 4200
TabIndex = 19
Text = "Combo5"
Top = 2760
Width = 1815
End
Begin VB.ComboBox cmb_term
Height = 300
ItemData = "frm_sjss3.frx":030E
Left = 4200
List = "frm_sjss3.frx":0318
TabIndex = 18
Text = "1"
Top = 3240
Width = 1815
End
Begin VB.TextBox Text6
Enabled = 0 'False
Height = 375
Left = 1920
TabIndex = 15
Top = 3240
Width = 1695
End
Begin VB.TextBox Text5
Enabled = 0 'False
Height = 375
Left = 1920
TabIndex = 14
Top = 2760
Width = 1695
End
Begin VB.TextBox Text4
Enabled = 0 'False
Height = 375
Left = 1920
TabIndex = 13
Top = 2280
Width = 1695
End
Begin VB.TextBox Text3
Enabled = 0 'False
Height = 375
Left = 1920
TabIndex = 12
Top = 1800
Width = 1695
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 375
Left = 1920
TabIndex = 11
Top = 1320
Width = 1695
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 375
Left = 1920
TabIndex = 10
Top = 840
Width = 1695
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "修改为:"
Height = 180
Left = 4800
TabIndex = 9
Top = 480
Width = 720
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "原资料:"
Height = 180
Left = 2400
TabIndex = 8
Top = 480
Width = 720
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "学 期:"
Height = 180
Left = 360
TabIndex = 7
Top = 3360
Width = 900
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "学 年:"
Height = 180
Left = 360
TabIndex = 6
Top = 2880
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "班 级:"
Height = 180
Left = 360
TabIndex = 5
Top = 2400
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "课 程:"
Height = 180
Left = 360
TabIndex = 4
Top = 1920
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "教 师:"
Height = 180
Left = 360
TabIndex = 3
Top = 1440
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "学 院:"
Height = 180
Left = 360
TabIndex = 2
Top = 960
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "修改项目"
Height = 180
Left = 360
TabIndex = 1
Top = 480
Width = 720
End
End
End
Attribute VB_Name = "frm_sjss3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public SJID As Integer
Public str_Institute As String, str_Teacher As String, str_Course As String
Public str_Classes As String, str_Year As String, str_term As String
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
Dim sql As String
sql = "update shijuan set "
sql = sql + " Institute='" + cmb_institute.Text
sql = sql + "', Teacher='" + cmb_teacher.Text
sql = sql + "', Course='" + cmb_course.Text
sql = sql + "', Classes='" + cmb_classes.Text
sql = sql + "', Year='" + cmb_year.Text
sql = sql + "', term='" + cmb_term.Text
sql = sql + "' where SJID=" + VBA.Str(SJID)
DB.Execute (sql)
Unload Me
frm_sjss2.DBGrid1.Refresh
End Sub
Private Sub Form_Load()
Dim i As Integer
Call Frm_main.menu_show(False) '菜单控制
Call combo_in2("institute", cmb_institute, str_Institute)
Call combo_in2("teacher", cmb_teacher, str_Teacher)
Call combo_in2("course", cmb_course, str_Course)
Call combo_in2("classes", cmb_classes, str_Classes)
For i = 0 To 9
cmb_year.AddItem (VBA.Trim(VBA.Str(2000 + i) + "-" + VBA.Str(2001 + i)))
If 2000 + i = Year(Now) Then
cmb_year.ListIndex = i
End If
Next i
Text1.Text = str_Institute
Text2.Text = str_Teacher
Text3.Text = str_Course
Text4.Text = str_Classes
Text5.Text = str_Year
Text6.Text = str_term
End Sub
Public Sub combo_in2(tname As String, cmb As ComboBox, txt As String)
Set RS = DB.OpenRecordset("select name from " + tname + " order by ID desc")
RS.MoveFirst
cmb.Clear
Dim i As Integer
i = 0
Do While Not RS.EOF
cmb.AddItem (RS.Fields("name").Value)
If txt = RS.Fields("name").Value Then
cmb.ListIndex = i
End If
i = i + 1
RS.MoveNext
Loop
End Sub
Private Sub Form_Unload(Cancel As Integer)
Frm_main.tform = "sjss2"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -