?? frmxuefei3.frm
字號:
VERSION 5.00
Begin VB.Form Frmxuefei3
BorderStyle = 1 'Fixed Single
Caption = "學費查詢"
ClientHeight = 3870
ClientLeft = 45
ClientTop = 330
ClientWidth = 5370
LinkTopic = "Form2"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3870
ScaleWidth = 5370
Begin VB.ComboBox Combo1
Height = 300
Index = 2
ItemData = "Frmxuefei3.frx":0000
Left = 2040
List = "Frmxuefei3.frx":0002
TabIndex = 9
Top = 1920
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 300
Index = 0
Left = 2040
TabIndex = 8
Top = 960
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 300
Index = 1
Left = 2040
TabIndex = 7
Top = 1440
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 300
Index = 3
Left = 2040
TabIndex = 6
Top = 2400
Width = 2775
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 255
Left = 1800
TabIndex = 0
Top = 3240
Width = 1095
End
Begin VB.Label Label5
Caption = "學期:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1320
TabIndex = 5
Top = 2520
Width = 1575
End
Begin VB.Label Label3
Caption = "學費設置查詢"
BeginProperty Font
Name = "華文中宋"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 4
Top = 240
Width = 2175
End
Begin VB.Label Label1
Caption = "年級:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1320
TabIndex = 3
Top = 980
Width = 975
End
Begin VB.Label Label2
Caption = "年制:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1320
TabIndex = 2
Top = 2040
Width = 735
End
Begin VB.Label Label4
Caption = "專業:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1320
TabIndex = 1
Top = 1560
Width = 1575
End
End
Attribute VB_Name = "Frmxuefei3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click(Index As Integer)
If Index <> 2 Then
Exit Sub
End If
Dim mrc As ADODB.Recordset
txtsql = "select * from class where 班級='" & Trim(Combo1(2).Text) & "'"
Set mrc = ExecuteSQL(txtsql)
If mrc.EOF = True Then
Combo1(0).Text = ""
Combo1(1).Text = ""
Exit Sub
End If
Combo1(0).Text = mrc.Fields(0)
Combo1(1).Text = mrc.Fields(4)
End Sub
Private Sub Command1_Click()
txtsql = ""
If Combo1(0).Text <> "" Then
If txtsql = "" Then
txtsql = "年級='" & Trim(Combo1(0).Text) & "'"
Else
txtsql = txtsql & "and 年級='" & Trim(Combo1(0).Text) & "'"
End If
End If
If Combo1(2).Text <> "" Then
If txtsql = "" Then
txtsql = "年制='" & Trim(Combo1(2).Text) & "'"
Else
txtsql = txtsql & "and 年制='" & Trim(Combo1(2).Text) & "'"
End If
End If
If Combo1(1).Text <> "" Then
aa = 1
If txtsql = "" Then
txtsql = "專業='" & Trim(Combo1(1).Text) & "'"
Else
txtsql = txtsql & "and 專業='" & Trim(Combo1(1).Text) & "'"
End If
End If
If Combo1(3).Text <> "" Then
aa = 1
If txtsql = "" Then
txtsql = "學期='" & Trim(Combo1(3).Text) & "'"
Else
txtsql = txtsql & "and 學期='" & Trim(Combo1(3).Text) & "'"
End If
End If
If txtsql = "" Then
ss = MsgBox("你至少要輸入一個條件以上才能查詢!", , " 警告")
Exit Sub
End If
txtsql = "select * from xuefei where " & txtsql
xuefeifind = True
Frmxuefei2.Show
Frmxuefei2.xuefeishowtitle
Frmxuefei2.xuefeishowdata
Frmxuefei2.Caption = "班級學費設置查詢結果"
'Frmxuefei2.ZOrder (0)
End Sub
Private Sub Form_Deactivate()
Unload Me
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
Combo1(0).AddItem ""
Do While Not mrc.EOF
Combo1(0).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
txtsql = "select DISTINCT 專業 from class "
Set mrc = ExecuteSQL(txtsql)
mrc.MoveFirst
Combo1(1).Clear
Combo1(1).AddItem ""
Do While Not mrc.EOF
Combo1(1).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
txtsql = "select DISTINCT 年制 from class "
Set mrc = ExecuteSQL(txtsql)
mrc.MoveFirst
Combo1(2).Clear
Combo1(2).AddItem ""
Do While Not mrc.EOF
Combo1(2).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
mrc.Close
Combo1(0).ListIndex = 0
Combo1(1).ListIndex = 0
Combo1(2).ListIndex = 0
Combo1(3).AddItem ""
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 & "年級第二學期"
Combo1(3).ListIndex = 0
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -