?? formjiao1.frm
字號:
VERSION 5.00
Begin VB.Form frmxuefei1
BorderStyle = 1 'Fixed Single
Caption = "學費設置"
ClientHeight = 3315
ClientLeft = 45
ClientTop = 330
ClientWidth = 6375
Icon = "Formjiao1.frx":0000
LinkTopic = "Form5"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3315
ScaleWidth = 6375
Begin VB.Frame Frame2
Caption = "學費設置"
Height = 2535
Left = 120
TabIndex = 0
Top = 600
Width = 6135
Begin VB.ComboBox Combo1
BackColor = &H80000018&
ForeColor = &H000000FF&
Height = 300
Index = 0
Left = 1080
TabIndex = 7
Text = "Combo1"
Top = 375
Width = 1215
End
Begin VB.ComboBox Combo1
BackColor = &H80000018&
ForeColor = &H000000FF&
Height = 300
Index = 1
Left = 3360
TabIndex = 6
Text = "Combo1"
Top = 360
Width = 1215
End
Begin VB.ComboBox Combo1
BackColor = &H80000018&
ForeColor = &H000000FF&
Height = 300
Index = 2
Left = 1080
TabIndex = 5
Text = "Combo1"
Top = 840
Width = 1215
End
Begin VB.ComboBox Combo1
BackColor = &H80000018&
ForeColor = &H000000FF&
Height = 300
Index = 3
Left = 3360
TabIndex = 4
Text = "Combo1"
Top = 840
Width = 2535
End
Begin VB.TextBox Text1
BackColor = &H80000018&
ForeColor = &H000000FF&
Height = 270
Left = 1080
TabIndex = 3
Top = 1395
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 255
Left = 1080
TabIndex = 2
Top = 2160
Width = 1335
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 255
Left = 3120
TabIndex = 1
Top = 2160
Width = 1335
End
Begin VB.Label Label6
Caption = "年制:"
Height = 255
Left = 480
TabIndex = 13
Top = 885
Width = 615
End
Begin VB.Label Label5
Caption = "學期:"
Height = 255
Left = 2760
TabIndex = 12
Top = 885
Width = 615
End
Begin VB.Label Label3
Caption = "專業:"
Height = 255
Left = 2760
TabIndex = 11
Top = 375
Width = 615
End
Begin VB.Label Label2
Caption = "年級:"
Height = 255
Left = 480
TabIndex = 10
Top = 360
Width = 615
End
Begin VB.Label Label4
Caption = "學費:"
Height = 255
Left = 480
TabIndex = 9
Top = 1440
Width = 615
End
Begin VB.Label Label7
Caption = " 元"
Height = 255
Left = 2400
TabIndex = 8
Top = 1440
Width = 615
End
End
Begin VB.Label Label1
Caption = "學費設置"
BeginProperty Font
Name = "楷體_GB2312"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 2400
TabIndex = 14
Top = 120
Width = 1695
End
End
Attribute VB_Name = "frmxuefei1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim clas As String
Private Sub Combo1_Click(Index As Integer)
Dim mrc As ADODB.Recordset
If Index = 0 Then
txtsql = "select DISTINCT 專業 from class where 年級='" & Trim(Combo1(0).Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = True Then
Combo1(1).Text = ""
Combo1(2).Text = ""
Exit Sub
End If
Combo1(1).Clear
mrc.MoveFirst
Do Until mrc.EOF
Combo1(1).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
Combo1(1).ListIndex = 0
txtsql = "select DISTINCT 年制 from class where 年級='" & Trim(Combo1(0).Text) & "' and 專業='" & Trim(Combo1(1).Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = True Then
Combo1(2).Text = ""
Exit Sub
End If
Combo1(2).Clear
mrc.MoveFirst
Do Until mrc.EOF
Combo1(2).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
Combo1(2).ListIndex = 0
ElseIf Index = 1 Then
txtsql = "select DISTINCT 年制 from class where 年級='" & Trim(Combo1(0).Text) & "' and 專業='" & Trim(Combo1(1).Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = True Then
Combo1(0).Text = ""
Combo1(2).Text = ""
Exit Sub
End If
Combo1(2).Clear
mrc.MoveFirst
Do Until mrc.EOF
Combo1(2).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
Combo1(2).ListIndex = 0
End If
End Sub
Private Sub Combo1_DropDown(Index As Integer)
If Index = 0 Then
Dim mrc As ADODB.Recordset
txtsql = "select DISTINCT 年級 from class "
Set mrc = ExecuteSQL(txtsql)
mrc.MoveFirst
Combo1(0).Clear
Do While Not mrc.EOF
Combo1(0).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
Combo1(0).ListIndex = 0
End If
End Sub
Private Sub Command1_Click()
If Combo1(0).Text = "" Then
ss = MsgBox("年級不能為空!", vbExclamation + vbOKOnly, " 警告")
Exit Sub
End If
If Combo1(1).Text = "" Then
ss = MsgBox("專業不能為空!", vbExclamation + vbOKOnly, " 警告")
Exit Sub
End If
If Combo1(2).Text = "" Then
ss = MsgBox("年制不能為空!", vbExclamation + vbOKOnly, " 警告")
Exit Sub
End If
If Combo1(3).Text = "" Then
ss = MsgBox("學期不能為空!", vbExclamation + vbOKOnly, " 警告")
Exit Sub
End If
If Text1.Text = "" Then
ss = MsgBox("學費不能為空!", vbExclamation + vbOKOnly, " 警告")
Exit Sub
End If
Dim mrc As ADODB.Recordset
txtsql = "select * from class where 專業='" & Trim(Combo1(1).Text) & "'and 年級='" & Trim(Combo1(0).Text) & "'and 年制='" & Trim(Combo1(2).Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = True Then
xxxx = MsgBox("查無 " & Combo1(0).Text & Combo1(2).Text & Combo1(1).Text & "專業的班, " & "請先進行班級設置!", , "警告")
Exit Sub
End If
txtsql = "select * from xuefei where 年級='" & Trim(Combo1(0).Text) & "' and 專業='" & Trim(Combo1(1).Text) & "'and 年制='" & Trim(Combo1(2).Text) & "' and 學期='" & Trim(Combo1(3).Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = False Then
If xuefeimodi = True Then
If (Text1.Text) <> Trim(Frmxuefei2.MSF1.TextMatrix(Frmxuefei2.MSF1.Row, 5)) Then
sss = MsgBox("已存在該班級本學期學費設置和學費記錄," & Chr(10) & Chr(13) & "繼續會導致以上的數據丟失,繼續嗎?!", vbOKCancel + vbExclamation, "警告")
End If
Else
sss = MsgBox("已存在該班級本學期學費設置和學費記錄," & Chr(10) & Chr(13) & "繼續會導致以上的數據丟失,繼續嗎?!", vbOKCancel + vbExclamation, "警告")
End If
If sss = vbCancel Then
Exit Sub
Else
If xuefeimodi = True Then
txtsql = "delete * from xuefei where 年級='" & Trim(Frmxuefei2.MSF1.TextMatrix(Frmxuefei2.MSF1.Row, 1)) & "' and 專業='" & Trim(Frmxuefei2.MSF1.TextMatrix(Frmxuefei2.MSF1.Row, 2)) & "'and 年制='" & Trim(Frmxuefei2.MSF1.TextMatrix(Frmxuefei2.MSF1.Row, 3)) & "' and 學期='" & Trim(Frmxuefei2.MSF1.TextMatrix(Frmxuefei2.MSF1.Row, 4)) & "'"
Else
txtsql = "delete * from xuefei where 年級='" & Trim(Combo1(0).Text) & "' and 專業='" & Trim(Combo1(1).Text) & "'and 年制='" & Trim(Combo1(2).Text) & "' and 學期='" & Trim(Combo1(3).Text) & "'"
End If
Set mrc = ExecuteSQL(txtsql)
txtsql = "delete * from jf where 學號 in(select DISTINCT xj.學號 from xj inner join class on xj.班級=class.班級 where 年級='" & Trim(Combo1(0).Text) & "' and 專業='" & Trim(Combo1(1).Text) & "'and 年制='" & Trim(Combo1(2).Text) & "') and 學期='" & Trim(Combo1(3).Text) & "'"
Set mrc = ExecuteSQL(txtsql)
End If
End If
txtsql = "select * from xuefei order by 學期,專業,年制"
Set mrc = ExecuteSQL(txtsql)
mrc.AddNew
mrc.Fields(0) = Trim(Combo1(0).Text)
mrc.Fields(1) = Trim(Combo1(1).Text)
mrc.Fields(2) = Trim(Combo1(2).Text)
mrc.Fields(3) = Trim(Combo1(3).Text)
mrc.Fields(4) = Trim(Text1.Text)
mrc.Update
If xuefeimodi = True Then
Unload Me
Else
For i = 0 To 3
Combo1(i).Text = ""
Next i
Text1.Text = ""
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Public Sub xuefeiload()
Dim mrc As ADODB.Recordset
If xuefeimodi Then '如果是修改狀態
Dim i As Integer
For i = 0 To 3
Combo1(i).Enabled = False
Next i
Text1.SetFocus
Me.Caption = "修改學費設置"
txtsql = "select * from xuefei where 年級='" & Trim(Combo1(0).Text) & "' and 專業='" & Trim(Combo1(1).Text) & "'and 年制='" & Trim(Combo1(2).Text) & "' and 學期='" & Trim(Combo1(3).Text) & "'"
txtsql = "select * from xuefei where 年級='" & Trim(Frmxuefei2.MSF1.TextMatrix(Frmxuefei2.MSF1.Row, 1)) & "' and 專業='" & Trim(Frmxuefei2.MSF1.TextMatrix(Frmxuefei2.MSF1.Row, 2)) & "'and 年制='" & Trim(Frmxuefei2.MSF1.TextMatrix(Frmxuefei2.MSF1.Row, 3)) & "' and 學期='" & Trim(Frmxuefei2.MSF1.TextMatrix(Frmxuefei2.MSF1.Row, 4)) & "'"
Set mrc = ExecuteSQL(txtsql)
mrc.MoveFirst
For i = 0 To 3
Combo1(i).Text = mrc.Fields(i)
Next i
Text1.Text = mrc.Fields(4)
mrc.Close
Else
For i = 0 To 3
frmxuefei1.Combo1(i).Enabled = True
Next i
Me.Caption = "添加班級設置"
For i = 0 To 3
Combo1(i).Text = ""
Next i
Text1.Text = ""
End If
End Sub
Private Sub Form_Load()
Dim mrc As ADODB.Recordset
txtsql = "select DISTINCT 年級 from class "
Set mrc = ExecuteSQL(txtsql)
mrc.MoveFirst
Combo1(0).Clear
Do While Not mrc.EOF
Combo1(0).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
Combo1(0).ListIndex = 0
txtsql = "select DISTINCT 專業 from class where 年級='" & Trim(Combo1(0).Text) & "'"
Set mrc = ExecuteSQL(txtsql)
Combo1(1).Clear
mrc.MoveFirst
Do While Not mrc.EOF
Combo1(1).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
Combo1(1).ListIndex = 0
txtsql = "select DISTINCT 年制 from class where 年級='" & Trim(Combo1(0).Text) & "' and 專業='" & Trim(Combo1(1).Text) & "'"
Combo1(2).Clear
Set mrc = ExecuteSQL(txtsql)
mrc.MoveFirst
Do While Not mrc.EOF
Combo1(2).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
Combo1(2).ListIndex = 0
mrc.Close
Combo1(3).AddItem Val(Format(Date, "yyyy")) - 1 & "---" & Val(Format(Date, "yyyy")) & "年度第一學期"
Combo1(3).AddItem Val(Format(Date, "yyyy")) - 1 & "---" & Val(Format(Date, "yyyy")) & "年度第二學期"
Combo1(3).AddItem Format(Date, "yyyy") & "---" & Val(Format(Date, "yyyy")) + 1 & "年度第一學期"
Combo1(3).AddItem Format(Date, "yyyy") & "---" & Val(Format(Date, "yyyy")) + 1 & "年度第二學期"
Combo1(3).AddItem Val(Format(Date, "yyyy")) + 1 & "---" & Val(Format(Date, "yyyy")) + 2 & "年度第一學期"
Combo1(3).AddItem Val(Format(Date, "yyyy")) + 1 & "---" & Val(Format(Date, "yyyy")) + 2 & "年度第二學期"
If Val(Format(Date, "mm")) > 8 Then
Combo1(3).ListIndex = 2
Else
Combo1(3).ListIndex = 1
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim i As Integer
For i = 0 To 3
Combo1(i).Enabled = True
Next i
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -