?? frmsqlbdate.frm
字號:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form frmsqlbdate
Caption = "生日查詢"
ClientHeight = 6435
ClientLeft = 60
ClientTop = 345
ClientWidth = 11880
LinkTopic = "Form1"
ScaleHeight = 6435
ScaleWidth = 11880
StartUpPosition = 1 '所有者中心
Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid1
Height = 5280
Left = 150
TabIndex = 9
Top = 990
Width = 11595
_ExtentX = 20452
_ExtentY = 9313
_Version = 393216
SelectionMode = 1
AllowUserResizing= 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_NumberOfBands = 1
_Band(0).Cols = 2
End
Begin VB.Frame Frame1
Height = 660
Left = 165
TabIndex = 4
Top = 225
Width = 4980
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 3660
TabIndex = 5
Text = "Combo1"
Top = 225
Width = 1230
End
Begin MSComCtl2.DTPicker DTPicker2
Height = 300
Left = 1065
TabIndex = 6
Top = 255
Width = 1470
_ExtentX = 2593
_ExtentY = 529
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
CustomFormat = "yyyy-MM-dd"
Format = 62324739
CurrentDate = 37828
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "查詢條件:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 0
Left = 2670
TabIndex = 8
Top = 300
Width = 945
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "查詢日期:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 1
Left = 75
TabIndex = 7
Top = 300
Width = 945
End
End
Begin VB.CommandButton Command1
Caption = "導出(&O)"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Index = 3
Left = 6600
TabIndex = 3
Top = 405
Width = 1275
End
Begin VB.CommandButton Command1
Caption = "打印(&X)"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Index = 2
Left = 7920
TabIndex = 2
Top = 405
Width = 1275
End
Begin VB.CommandButton Command1
Caption = "查詢(&Q)"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Index = 1
Left = 5250
TabIndex = 1
Top = 405
Width = 1275
End
Begin VB.CommandButton Command1
Cancel = -1 'True
Caption = "退出(&X)"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Index = 0
Left = 9240
TabIndex = 0
Top = 405
Width = 1275
End
End
Attribute VB_Name = "frmsqlbdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private rsSupplier As ADODB.Recordset
Private Sub Command1_Click(Index As Integer)
Dim strsql As String
Dim mrc As ADODB.Recordset
Select Case Index
Case 0
Unload Me
Case 1
If Me.Combo1.ListIndex = 0 Then
Set mrc = New ADODB.Recordset
strsql = "select c_id,c_fname,c_mname,c_baby1,c_sex1,c_bdate1,c_ad1,c_tl1"
strsql = strsql & " ,c_baby2,c_sex2,c_bdate2,c_ad2,c_tl2"
strsql = strsql & " from customer where format(c_bdate1,'MMdd')='" & Format(Me.DTPicker2.Value, "MMdd") & "'"
strsql = strsql & " or format(c_bdate2,'MMdd')='" & Format(Me.DTPicker2.Value, "MMdd") & "'"
mrc.Open strsql, DEjxc.Conjxc, adOpenDynamic, adLockOptimistic
Set Me.MSHFlexGrid1.DataSource = mrc
showtitle
Else
Set mrc = New ADODB.Recordset
strsql = "select c_id,c_fname,c_mname,c_baby1,c_sex1,c_bdate1,c_ad1,c_tl1"
strsql = strsql & " ,c_baby2,c_sex2,c_bdate2,c_ad2,c_tl2"
strsql = strsql & " from customer where format(c_bdate1,'MM')='" & Format(Me.DTPicker2.Value, "MM") & "'"
strsql = strsql & " or format(c_bdate2,'MM')='" & Format(Me.DTPicker2.Value, "MM") & "'"
mrc.Open strsql, DEjxc.Conjxc, adOpenDynamic, adLockOptimistic
Set Me.MSHFlexGrid1.DataSource = mrc
showtitle
End If
End Select
End Sub
Private Sub Form_Load()
Me.DTPicker2.Value = dteSysDate
Me.Combo1.AddItem "按日期"
Me.Combo1.AddItem "按月份"
Me.Combo1.ListIndex = 0
Command1_Click (1)
End Sub
Private Sub Form_Resize()
' Me.DataGrid1.Height = Me.Height - 2000
' Me.DataGrid1.Width = Me.Width - 450
End Sub
Public Sub showtitle()
With MSHFlexGrid1
.colWidth(0, 0) = 150
.TextMatrix(0, 1) = "編號"
.colWidth(1, 0) = 500
.TextMatrix(0, 2) = "父親姓名"
.colWidth(2, 0) = 900
.TextMatrix(0, 3) = "母親姓名"
.colWidth(3, 0) = 900
.TextMatrix(0, 4) = "嬰兒姓名1"
.colWidth(4, 0) = 900
.TextMatrix(0, 5) = "性別1"
.colWidth(5, 0) = 500
.TextMatrix(0, 6) = "出生年月1"
.colWidth(6, 0) = 1000
.TextMatrix(0, 7) = "聯系地址1"
.colWidth(7, 0) = 1800
.TextMatrix(0, 8) = "聯系電話1"
.colWidth(8, 0) = 1000
.TextMatrix(0, 9) = "嬰兒姓名2"
.colWidth(9, 0) = 900
.TextMatrix(0, 10) = "性別2"
.colWidth(10, 0) = 500
.TextMatrix(0, 11) = "出生年月2"
.colWidth(11, 0) = 1000
.TextMatrix(0, 12) = "聯系地址2"
.colWidth(15, 0) = 1100
.TextMatrix(0, 13) = "聯系電話2"
.colWidth(16, 0) = 800
End With
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -