📄 main_gzcx.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form main_gzcx
BackColor = &H8000000B&
BorderStyle = 1 'Fixed Single
Caption = "挂账查询"
ClientHeight = 4110
ClientLeft = 120
ClientTop = 405
ClientWidth = 9360
Icon = "main_gzcx.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
ScaleHeight = 4110
ScaleWidth = 9360
StartUpPosition = 2 '屏幕中心
Begin VB.ComboBox Combo1
Height = 300
Left = 2325
TabIndex = 8
Top = 105
Width = 2400
End
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 2160
Top = 4275
Width = 1560
_ExtentX = 2752
_ExtentY = 582
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 = "Adodc2"
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 MSAdodcLib.Adodc Adodc1
Height = 375
Left = 4860
Top = 4200
Width = 1875
_ExtentX = 3307
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\程序修改\宾馆客房管理系统\宾馆客房管理系统\DB_KFGL.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\程序修改\宾馆客房管理系统\宾馆客房管理系统\DB_KFGL.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from tb_gzmx"
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 MSDataGridLib.DataGrid DataGrid1
Height = 2895
Left = 120
TabIndex = 7
Top = 555
Width = 9135
_ExtentX = 16113
_ExtentY = 5106
_Version = 393216
AllowUpdate = 0 'False
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
Begin VB.TextBox czy
BackColor = &H80000004&
BorderStyle = 0 'None
Height = 255
Left = 900
TabIndex = 6
Top = 3720
Width = 1305
End
Begin VB.CommandButton Command1
Caption = "退出"
Height = 375
Left = 6870
TabIndex = 0
Top = 3645
Width = 2115
End
Begin MSComCtl2.DTPicker DTP1
Height = 285
Left = 6030
TabIndex = 2
Top = 90
Width = 1425
_ExtentX = 2514
_ExtentY = 503
_Version = 393216
Format = 100139009
CurrentDate = 37132
End
Begin MSComCtl2.DTPicker DTP2
Height = 285
Left = 7830
TabIndex = 3
Top = 90
Width = 1410
_ExtentX = 2487
_ExtentY = 503
_Version = 393216
Format = 100139009
CurrentDate = 37132
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "操作员:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 225
Left = 60
TabIndex = 5
Top = 3690
Width = 780
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "日期 到"
Height = 300
Left = 5505
TabIndex = 4
Top = 165
Width = 2505
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 = 240
Left = 75
TabIndex = 1
Top = 135
Width = 2445
End
End
Attribute VB_Name = "main_gzcx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Sub CX() '定义查询挂账信息的函数
Adodc1.RecordSource = "select * from tb_gzmx where tb_gzmx.挂账单位 = '" & Combo1.text & "' and tb_gzmx.日期 between # " + Str(DTP1.Value) + "# and #" + Str(DTP2.Value) + "# order by 日期,时间 "
Adodc1.Refresh
End Sub
Private Sub Combo1_Click() '查询挂账信息
Call CX '调用函数
End Sub
Private Sub Form_Load()
'自动识别数据库路径
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DB_KFGL.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from tb_gzmx"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
Adodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DB_KFGL.mdb;Persist Security Info=False"
Adodc2.RecordSource = "select distinct 挂账单位 from tb_gzmx "
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
For i = 1 To Adodc2.Recordset.RecordCount
Combo1.AddItem Adodc2.Recordset.Fields("挂账单位").Value
Adodc2.Recordset.MoveNext
Next i
End If
End Sub
Private Sub Form_Activate()
czy.text = Main.StatusBar1.Panels(4).text
DTP1.Value = Date - 30: DTP2.Value = Date '初始化日期
'DateTimePicker控件DateTimePicker控件使您可以提供格式化的日期字段,使得进行日期选择很容易。另外,用户还可以从类似于MonthView控件的下拉式日历界面中选择日期。
End Sub
Private Sub Form_Unload(Cancel As Integer)
Main.Enabled = True
End Sub
Private Sub DTP1_Change()
Call CX '调用函数
End Sub
Private Sub DTP2_Change()
Call CX '调用函数
End Sub
Private Sub Command1_Click()
Main.Enabled = True
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -