?? caiwu.frm
字號:
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 2655
Left = 240
TabIndex = 11
Top = 1440
Width = 10575
_ExtentX = 18653
_ExtentY = 4683
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 23
FormatLocked = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
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
Caption = "消費匯總"
ColumnCount = 3
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
BeginProperty Column02
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
BeginProperty Column02
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc2
Height = 375
Left = 5280
Top = 3120
Visible = 0 'False
Width = 1215
_ExtentX = 2143
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "總金額:"
Height = 180
Left = 9240
TabIndex = 13
Top = 4200
Width = 720
End
Begin VB.Label id
AutoSize = -1 'True
Caption = "0"
Height = 180
Left = 1200
TabIndex = 12
Top = 1080
Visible = 0 'False
Width = 90
End
Begin VB.Label count1
AutoSize = -1 'True
Caption = "0"
Height = 180
Left = 10200
TabIndex = 10
Top = 4200
Width = 90
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
Left = 3360
TabIndex = 8
Top = 360
Width = 840
End
Begin VB.Label Label9
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
Left = 240
TabIndex = 7
Top = 360
Width = 735
End
End
Attribute VB_Name = "caiwu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim sql As String
If Check1.Value = 1 Then
sql = "select 姓名,編碼,sum(金額) as 金額 from 收費表 where 姓名 like '%" & Trim(v_name.Text) & "%' and 編碼 like '%" & Trim(v_car.Text) & "%' and 日期 between '" & Trim(sj1.Value) & "' and '" & Trim(sj2.Value) & "' group by 姓名,編碼"
End If
If Check1.Value = 0 Then
sql = "select 姓名,編碼,sum(金額) as 金額 from 收費表 where 姓名 like '%" & Trim(v_name.Text) & "%' and 編碼 like '%" & Trim(v_car.Text) & "%' group by 姓名,編碼"
End If
Dim rs As New ADODB.Recordset
rs.Open sql, db
If Not rs.EOF Then
count1.Caption = rs("金額")
Adodc1.CommandType = adCmdText
Adodc1.ConnectionString = db
Adodc1.RecordSource = sql
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub DataGrid1_Click()
id.Caption = CStr(Adodc1.Recordset.Fields("編碼"))
sql = "select * from 收費明細表 where 卡號='" & Trim(id.Caption) & "'"
Dim rs As New ADODB.Recordset
rs.Open sql, db
Adodc2.CommandType = adCmdText
Adodc2.ConnectionString = db
Adodc2.RecordSource = sql
Set DataGrid2.DataSource = Adodc2
Adodc2.Refresh
End Sub
Private Sub Form_Load()
sj1.Value = Date
sj2.Value = Date
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -