【VB开源代码栏目提醒】:网学会员为需要VB开源代码的朋友们搜集整理了FMCheckQuery.frm相关资料,希望对各位网友有所帮助!
VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDatGrd.ocx"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form FMCheckQuery
Caption = "帐单查询"
ClientHeight = 5025
ClientLeft = 60
ClientTop = 345
ClientWidth = 9420
LinkTopic = "Form1"
ScaleHeight = 5025
ScaleWidth = 9420
StartUpPosition = 3 '窗口缺省
Begin MSComCtl2.DTPicker DTPicker1
Height = 300
Left = 3960
TabIndex = 9
Top = 165
Width = 1335
_ExtentX = 2355
_ExtentY = 529
_Version = 393216
Format = 20709377
CurrentDate = 39049
End
Begin VB.ComboBox CombMemberID
Height = 300
Left = 6720
TabIndex = 8
Top = 165
Width = 975
End
Begin VB.Frame Frame1
Height = 3735
Left = 0
TabIndex = 3
Top = 600
Width = 9375
Begin MSDataGridLib.DataGrid DataGrid1
Height = 3375
Left = 120
TabIndex = 4
Top = 240
Width = 9135
_ExtentX = 16113
_ExtentY = 5953
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
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
Begin VB.CommandButton ComdQuery
Caption = "
查询"
Height = 495
Left = 8400
TabIndex = 2
Top = 120
Width = 735
End
Begin VB.CommandButton ComdCancel
Caption = "取消"
Height = 495
Left = 8160
TabIndex = 1
Top = 4440
Width = 735
End
Begin VB.ComboBox CombRoomID
Height = 300
Left = 1440
TabIndex = 0
Top = 165
Width = 975
End
Begin
VB.Label Label3
Caption = "会员编号:"
Height = 255
Left = 5640
TabIndex = 7
Top = 210
Width = 975
End
Begin VB.Label Label2
Caption = "日期查询:"
Height = 255
Left = 2760
TabIndex = 6
Top = 210
Width = 975
End
Begin VB.Label Label1
Caption = "房间编号:"
Height = 255
Left = 360
TabIndex = 5
Top = 210
Width = 975
End
End
Attribute VB_Name = "FMCheckQuery"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public Conn As New Connection
Private Sub ComdCancel_Click()
Conn.Close
Unload Me
End Sub
Private Sub ComdQuery_Click()
Dim SqlStr As String
Dim rsCheck As New Recordset
Dim sRoomID As String
Dim sMemberID As String
Dim dOTime As String
sRoomID = Trim(Me.CombRoomID.Text)
sMemberID = Trim(Me.CombMemberID.Text)
dOTime = Trim(Me.DTPicker1.Value)
SqlStr = "select CheckID as 帐单编号,OpenDate as 开房日期" & ",MemberID as
会员编号,ClientName as 客户" & ",RoomID as 房间编号,RoomType as 房间类型" & ",RoomPrice as 房间价格,OpenRoomTime as 开房时间" & ",EndTime as 结束时间,Prepay as 预付金额" & ",Agio as 折扣,PayMode as 付款方式,RoomMoney as 消费金额 " & "from CheckInfo where RoomID like " & "" & " '%" & sRoomID & "%'" & "and MemberID like " & "'%" & sMemberID & "%'" & "and OpenDate ='" & dOTime & "'"
Set rsCheck = Conn.Execute(SqlStr)
Set DataGrid1.DataSource = rsCheck
Set rsCheck = Nothing
End Sub
Private Sub Form_Load()
Me.Top = (Screen.Height - Me.Height) / 2 '垂直方向居中
Me.Left = (Screen.Width - Me.Height) / 2 '水平方向居中
With Conn
Conn.CursorLocation = adUseClient
Conn.CommandTimeout = 10
Conn.ConnectionString = g_ConnStr
Conn.Open
End With
Dim SqlStr As String
Dim rsDestine As New Recordset
SqlStr = "select CheckID as 帐单编号,OpenDate as 开房日期" & ",MemberID as 会员编号,ClientName as 客户" & ",RoomID as 房间编号,RoomType as 房间类型" & ",RoomPrice as 房间价格,OpenRoomTime as 开房时间" & ",EndTime as 结束时间,Agio as 折扣,Prepay as 预付金额" & ",PayMode as 付款方式,RoomMoney as 消费金额 from CheckInfo"
Set rsDestine = Conn.Execute(SqlStr)
Me.DataGrid1.ColumnHeaders = True
Set DataGrid1.DataSource = rsDestine
Set rsDestine = Nothing
'从数据库中读取数据写入房间编号下拉列