?? frmxuefei2.frm
字號:
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public printstr As String
Public Sub xuefeishowtitle()
Dim i As Integer
With MSF1
.Cols = 6
.TextMatrix(0, 1) = "年級"
.TextMatrix(0, 2) = "專業"
.TextMatrix(0, 3) = "年制"
.TextMatrix(0, 4) = "學期"
.TextMatrix(0, 5) = "學費(元)"
.ColWidth(0) = 200
.ColWidth(1) = 2000
.ColWidth(2) = 2000
.ColWidth(3) = 2000
.ColWidth(4) = 3000
.ColWidth(5) = 1500
.FixedRows = 1
For i = 1 To 5
.ColAlignment(i) = 0
Next i
.FillStyle = flexFillSingle
.Col = 0
.Row = 0
.RowSel = 1
.ColSel = .Cols - 1
.CellAlignment = 4
.Row = 1
End With
End Sub
Public Sub xuefeishowdata()
MSF1.Clear
Dim j As Integer
Dim i As Integer
xuefeishowtitle
MSF1.Rows = 2
Dim mrc As ADODB.Recordset
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = False Then
mrc.MoveFirst
With MSF1
.Rows = 4
.Row = 1
Do While Not mrc.EOF
.Rows = .Rows + 1
For i = 1 To mrc.Fields.Count
.TextMatrix(.Row, i) = mrc.Fields(i - 1)
Next i
.Row = .Row + 1
mrc.MoveNext
Loop
End With
xuefeishowtitle
Else
If xuefeifind = True Then
Frmxuefei2.Hide
Frmxuefei3.Show
zzz = MsgBox("對不起,沒有此班級的學費設置檔案記錄!", vbOKOnly, "查詢")
Frmxuefei3.ZOrder (0)
End If
End If
mrc.Close
End Sub
Private Sub Combo1_Click(Index As Integer)
If Option1.Value = True Then
Else
txtsql = "select * from xuefei where 年級='" & Trim(Combo1(0).Text) & _
"' and 專業='" & Trim(Combo1(1).Text) & "' and 年制='" & Trim(Combo1(2).Text) & _
"' and 學期='" & Trim(Combo1(3).Text) & "'"
xuefeishowdata
printstr = txtsql
End If
End Sub
Private Sub Form_Activate()
If xuefeimodi = True Then
xuefeishowdata
xuefeimodi = False
End If
End Sub
Private Sub Form_Load()
If Option1.Value = True Then
txtsql = "select * from xuefei order by 學期,專業,年制"
For i = 0 To 3
Combo1(i).Enabled = False
Next i
printstr = txtsql
xuefeishowdata
End If
End Sub
Private Sub Option1_Click()
For i = 0 To 3
Combo1(i).Enabled = False
Next i
txtsql = "select * from xuefei order by 學期,專業,年制"
xuefeishowdata
printstr = txtsql
End Sub
Private Sub Option2_Click()
For i = o To 3
Combo1(i).Enabled = True
Next i
Dim mrc As ADODB.Recordset
txtsql = "select DISTINCT 年級 from xuefei "
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 xuefei"
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 xuefei"
Set mrc = ExecuteSQL(txtsql)
Combo1(2).Clear
mrc.MoveFirst
Do While Not mrc.EOF
Combo1(2).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
Combo1(2).ListIndex = 0
txtsql = "select DISTINCT 學期 from xuefei "
Set mrc = ExecuteSQL(txtsql)
Combo1(3).Clear
mrc.MoveFirst
Do While Not mrc.EOF
Combo1(3).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
Combo1(3).ListIndex = 0
Set mrc = Nothing
txtsql = "select * from xuefei where 年級='" & Trim(Combo1(0).Text) & "' and 專業='" & _
Trim(Combo1(1).Text) & "' and 年制='" & Trim(Combo1(2).Text) & "' and 學期='" & _
Trim(Combo1(3).Text) & "' order by 學期,專業,年制"
xuefeishowdata
printstr = txtsql
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Tag
Case "find"
Form4.Show
Case "modi"
qxstr = Executeqx(3)
If qxstr = "readonly" Then
ss = MsgBox("對不起,你是只讀用戶不能添加記錄,請與管理員聯系!", _
vbInformation + vbOKOnly, " 警告")
Exit Sub
End If
xuefeimodi = True
If Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) = "" Then
MsgBox "已無記錄!", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
frmxuefei1.Show
frmxuefei1.xuefeiload
frmxuefei1.ZOrder 0
Case "del"
qxstr = Executeqx(3)
If qxstr = "readonly" Then
ss = MsgBox("對不起,你是只讀用戶不能添加記錄,請與管理員聯系!", _
vbInformation + vbOKOnly, " 警告")
Exit Sub
End If
Dim mrc As ADODB.Recordset
Dim msgtext As String
Dim intcount As Integer
If Me.MSF1.Rows > 1 Then
If Trim(Me.MSF1.TextMatrix(MSF1.Row, 1)) = "" Then
sssss = MsgBox("已無記錄!", vbOKOnly + vbExclamation, "警告")
Exit Sub
End If
If MsgBox("確定要刪除此記錄嗎?", vbOKCancel + vbExclamation, "警告") = vbOK Then
intcount = Me.MSF1.Row
txtsql = "delete from xuefei where 年級='" & Trim(Me.MSF1.TextMatrix(Me.MSF1.Row, 1)) & _
"' and 專業='" & Trim(Me.MSF1.TextMatrix(Me.MSF1.Row, 2)) & "'and 年制='" & _
Trim(Me.MSF1.TextMatrix(Me.MSF1.Row, 3)) & "' and 學期='" & _
Trim(Me.MSF1.TextMatrix(Me.MSF1.Row, 4)) & "'"
Set mrc = ExecuteSQL(txtsql)
If Option1.Value = True Then
txtsql = "select * from xuefei order by 學期,專業,年制"
Else
txtsql = "select xuefei.班級,class.年級,class.專業,class.年制,xuefei.學期," & _
" xuefei.學費,xuefei.備注 from xuefei inner join class on xuefei.班級=class.班級 " & _
" order by xuefei.學期 desc, class.年級 desc,class.班級 desc"
txtsql = "select * from xuefei where 年級='" & Trim(Combo1(0).Text) & _
"' and 專業='" & Trim(Combo1(1).Text) & "' and 年制='" & Trim(Combo1(2).Text) & _
"' and 學期='" & Trim(Combo1(3).Text) & "'"
End If
xuefeishowdata
End If
Else
MsgBox "你還沒有選擇記錄!", vbExclamation + vbOKOnly, "警告"
End If
End Select
End Sub
Private Sub Toolbar1_ButtonMenuClick(ByVal ButtonMenu As MSComctlLib.ButtonMenu)
Select Case ButtonMenu.Key
Case "dang"
If Trim(printstr) = "" Then
sssss = MsgBox("沒有當前記錄!", vbOKOnly + vbExclamation, "警告")
Exit Sub
End If
If DataEnv1.rsCommand3.State = adStateOpen Then
DataEnv1.rsCommand3.Close
End If
DataEnv1.rsCommand3.Open printstr
If DataEnv1.rsCommand3.EOF = True Then
sssss = MsgBox("沒有當前記錄!", vbOKOnly + vbExclamation, "警告")
Exit Sub
End If
DataReportxuefei.Show 1
Case "all"
If DataEnv1.rsCommand3.State = adStateOpen Then
DataEnv1.rsCommand3.Close
End If
DataEnv1.rsCommand3.Open ("select * from xuefei")
If DataEnv1.rsCommand3.EOF = True Then
sssss = MsgBox("沒有當前記錄!", vbOKOnly + vbExclamation, "警告")
Exit Sub
End If
DataReportxuefei.Show 1
End Select
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -