?? f_laowufeicx.frm
字號:
Left = 360
TabIndex = 14
Top = 840
Visible = 0 'False
Width = 735
End
Begin VB.Label Label2
Caption = "時間"
Height = 255
Left = 2160
TabIndex = 13
Top = 360
Width = 975
End
Begin VB.Label Label1
Caption = "項目"
Height = 255
Left = 720
TabIndex = 12
Top = 360
Width = 975
End
End
Begin VB.Frame Frame2
Caption = "查詢結果"
Height = 4695
Left = 0
TabIndex = 0
Top = 1680
Width = 9735
Begin VB.CommandButton Command3
Caption = "顯示"
Height = 375
Left = 8400
TabIndex = 1
Top = 4200
Width = 1095
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 3615
Left = 240
TabIndex = 2
Top = 360
Width = 9255
_ExtentX = 16325
_ExtentY = 6376
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
End
Attribute VB_Name = "F_LaoWuFeiCX"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim WithEvents rs As Recordset
Attribute rs.VB_VarHelpID = -1
Dim WithEvents adoPrimaryRS As Recordset
Attribute adoPrimaryRS.VB_VarHelpID = -1
Dim WithEvents adoXianshiRS As Recordset
Attribute adoXianshiRS.VB_VarHelpID = -1
Dim Row_ID As String '為找到ID 的查詢SQL 語句
Private Sub Check1_Click()
If Check1.Value = 1 Then
Check2.Value = 0
Combo1.Clear
SQL = "select distinct 項目 from 勞務費登記"
Set rs = db.Execute(SQL)
Do While Not rs.EOF
If IsNull(rs("項目")) = False Then
Combo1.AddItem rs("項目")
End If
rs.MoveNext
Loop
Combo1.Visible = True
Label4.Visible = False
Label5.Visible = False
DTPicker1.Visible = False
DTPicker2.Visible = False
Frame2.Visible = False
Frame3.Visible = False
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = 1 Then
Check1.Value = 0
Combo1.Visible = False
Label4.Visible = True
Label5.Visible = True
DTPicker1.Visible = True
DTPicker2.Visible = True
Frame2.Visible = False
Frame3.Visible = False
End If
End Sub
Private Sub CmdXianShi_Exit_Click()
Frame2.Visible = True
Frame3.Visible = False
End Sub
Private Sub Command1_Click()
Dim DataGrid_sql As String '數(shù)據表格中的數(shù)據源
Dim oText As TextBox
If Check1.Value = 1 Then
DataGrid_sql = "select * from 勞務費登記 where 項目 ='" & Combo1.Text & "'"
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open DataGrid_sql, db, adOpenStatic, adLockOptimistic
Set DataGrid1.DataSource = adoPrimaryRS
Frame3.Visible = False
Frame2.Visible = True
End If
If Check2.Value = 1 Then
DataGrid_sql = "select * from 勞務費登記 where 時間 between ' " & DTPicker1 & " ' and ' " & DTPicker2 & " '"
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open DataGrid_sql, db, adOpenStatic, adLockOptimistic
Set DataGrid1.DataSource = adoPrimaryRS
Frame3.Visible = False
Frame2.Visible = True
End If
End Sub
Private Sub Command2_Click()
RSGL.Enabled = True
Unload Me
End Sub
Private Sub Command3_Click()
Dim XianShi_sql As String '單條數(shù)據顯示的數(shù)據源
If Row_ID = "" Then
MsgBox "請您選擇其中一條信息!"
Exit Sub
Else
XianShi_sql = "select * from 勞務費登記 where ID = " & Row_ID
Set adoXianshiRS = New Recordset
adoXianshiRS.Open XianShi_sql, db, adOpenStatic, adLockOptimistic
For Each oText In Me.txtFields
Set oText.DataSource = adoXianshiRS
Next
Set DTPicker3.DataSource = adoXianshiRS
Set Combo3.DataSource = adoXianshiRS
End If
Frame2.Visible = False
Frame3.Visible = True
End Sub
Private Sub DataGrid1_Click()
If Not adoPrimaryRS.BOF And Not adoPrimaryRS.EOF Then
If Not IsNull(adoPrimaryRS.Fields("ID")) Then
Row_ID = adoPrimaryRS.Fields("ID")
Else
MsgBox "請您選擇其中一條信息!"
End If
Else
Exit Sub
End If
End Sub
Private Sub Form_Load()
On Error Resume Next
For Each TextBox In Me.Controls
TextBox.Font.Name = "宋體"
TextBox.Font.Size = 9
Next
Frame2.Visible = False
Frame3.Visible = False
For Each oText In Me.txtFields
oText.Locked = True
Next
DTPicker3.Enabled = True
Combo3.Enabled = True
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -