📄 form9.frm
字号:
VERSION 5.00
Object = "{CFA7AFF4-3242-4269-9172-7389D695AE01}#1.0#0"; "StoneXP.ocx"
Object = "{DAAC6951-59A4-4C08-9D6E-FE3919B64861}#1.0#0"; "FlexCell.ocx"
Begin VB.Form Form9
BorderStyle = 1 'Fixed Single
Caption = "加油信息查询"
ClientHeight = 8130
ClientLeft = 45
ClientTop = 375
ClientWidth = 10665
LinkTopic = "Form9"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 8130
ScaleWidth = 10665
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3240
TabIndex = 3
Top = 7320
Width = 2535
End
Begin FlexCell.Grid Grid1
Height = 6615
Left = 0
TabIndex = 0
Top = 360
Width = 10575
_ExtentX = 18653
_ExtentY = 11668
Cols = 5
Rows = 30
End
Begin StoneXP.XPButton XPButton3
Height = 375
Left = 8280
TabIndex = 1
Top = 7320
Width = 1455
_ExtentX = 2566
_ExtentY = 661
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
Caption = "退出查询"
MouseIcon = "Form9.frx":0000
MousePointer = 99
End
Begin StoneXP.XPButton XPButton2
Height = 375
Left = 6120
TabIndex = 2
Top = 7320
Width = 1455
_ExtentX = 2566
_ExtentY = 661
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
Caption = "查 询"
MouseIcon = "Form9.frx":031A
MousePointer = 99
End
Begin VB.Label Label1
Caption = "请输入单位名称:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 4
Top = 7440
Width = 1935
End
End
Attribute VB_Name = "Form9"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim str As String
Private Sub Form_Load()
Grid1.SetRegisterInformation "CNwinndy", "W]vyY-nonvk-u\nty-Zbl_e-`hms^" '进行注册
On Error GoTo finish
mdi = False
str = "select * from 加油信息"
Grid1.Cols = 8
Grid1.Column(1).Width = 80
Grid1.Column(2).Width = 120
Grid1.Column(3).Width = 80
Grid1.Column(4).Width = 80
Grid1.Column(5).Width = 120
Grid1.Column(6).Width = 120
Grid1.Column(7).Width = 80
With Grid1
.AllowUserResizing = True
.DisplayFocusRect = False
.ExtendLastCol = True
.Appearance = Flat
.FixedRowColStyle = Flat
.ScrollBarStyle = Flat
.DefaultFont.Name = "Tahoma"
.DefaultFont.Size = 8
.BackColorFixed = RGB(84, 201, 134)
.BackColorFixedSel = RGB(167, 111, 177)
.BackColorBkg = RGB(198, 229, 211)
.BackColorScrollBar = RGB(167, 111, 177)
.BackColor1 = RGB(231, 235, 247)
.BackColor2 = RGB(198, 229, 211)
.GridColor = RGB(148, 190, 231)
.Column(0).Width = 0
End With
Exit Sub
finish:
MsgBox Err.Description
End Sub
Private Sub Form_Unload(Cancel As Integer)
mdi = True
End Sub
Private Sub XPButton2_Click()
'On Error GoTo finish
If Text1.Text <> "" Then
'str = "select * from 课程信息 where 先修课='" & Text1.Text & "'"
Set mdbrs = mdbconn.Execute("select * from 加油信息 where 单位名称='" & Text1.Text & "' order by 月份 asc")
Call callmain
Else
MsgBox "请输入单位名称!"
End If
Exit Sub
finish:
MsgBox Err.Description
Text1.Text = "="
End Sub
Private Sub XPButton3_Click()
Unload Me
End Sub
Private Sub callmain()
On Error GoTo finish
Grid1.Rows = 1
i = 7
Grid1.Cols = i + 1
For i = 0 To 6
If i = 3 Then
Grid1.Cell(0, i + 1).Text = mdbrs.Fields(i).Name & "(元/升)"
Else
If i = 4 Then
Grid1.Cell(0, i + 1).Text = mdbrs.Fields(i).Name & "(升)"
Else
If i = 5 Then
Grid1.Cell(0, i + 1).Text = mdbrs.Fields(i).Name & "(元)"
Else
Grid1.Cell(0, i + 1).Text = mdbrs.Fields(i).Name
End If
End If
End If
Next
i = 1
Do While Not mdbrs.EOF
Grid1.Rows = Grid1.Rows + 1
For j = 1 To 7 '设定读取列
If mdbrs.Fields(j - 1) = Null Then '空值的处理
Grid1.Cell(i, j).Text = ""
Else
Grid1.Cell(i, j).Text = mdbrs.Fields(j - 1)
End If
Next
i = i + 1
mdbrs.MoveNext '读取下一记录
Loop
For i = 1 To 7
Grid1.Column(i).Locked = True
Next
Exit Sub
finish:
MsgBox Err.Description
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -