【VB开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了VB开源代码-frmBuildingstyleFind.frm的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
VERSION 5.00
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "mshflxgd.ocx"
Begin VB.Form frmBuildingstyleFind
BackColor = &H00C0FFFF&
BorderStyle = 3 'Fixed Dialog
Caption = "户型查询"
ClientHeight = 6270
ClientLeft = 45
ClientTop = 435
ClientWidth = 6750
Icon = "frmBuildingstyleFind.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6270
ScaleWidth = 6750
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
BackColor = &H00C0FFFF&
Caption = "查询条件"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C000C0&
Height = 2295
Left = 240
TabIndex = 1
Top = 0
Width = 6255
Begin VB.OptionButton Option3
BackColor = &H00C0FFFF&
Caption = "户型结构:"
Height = 255
Left = 240
TabIndex = 9
Top = 1320
Width = 1215
End
Begin VB.TextBox txthuxingnum
Height = 375
Left = 1440
TabIndex = 8
Top = 360
Width = 1455
End
Begin VB.TextBox txtmianji1
Height = 375
Left = 1440
TabIndex = 7
Top = 840
Width = 1455
End
Begin VB.TextBox txtmianji2
Height = 375
Left = 3720
TabIndex = 6
Top = 840
Width = 1455
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1440
Style = 2 'Dropdown List
TabIndex = 5
Top = 1320
Width = 1695
End
Begin VB.CommandButton cmdfind
Caption = "查 询"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 4
Top = 1800
Width = 1215
End
Begin
VB.CommandButton cmdexit
Caption = "退 出"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4320
TabIndex = 3
Top = 1800
Width = 1335
End
Begin VB.CommandButton cmdall
Caption = "所 有"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2520
TabIndex = 2
Top = 1800
Width = 1215
End
Begin VB.OptionButton Option1
BackColor = &H00C0FFFF&
Caption = "户型编号:"
Height = 255
Left = 240
TabIndex = 11
Top = 360
Width = 1455
End
Begin VB.OptionButton Option2
BackColor = &H00C0FFFF&
Caption = "建筑面积:"
Height = 255
Left = 240
TabIndex = 10
Top = 840
Width = 1455
End
Begin VB.Label Label1
BackColor = &H00C0FFFF&
Caption = "平方米"
Height = 375
Left = 5160
TabIndex = 13
Top = 960
Width = 855
End
Begin VB.Label Label2
BackColor = &H00C0FFFF&
Caption = "----"
Height = 375
Left = 3120
TabIndex = 12
Top = 960
Width = 495
End
End
Begin MSHierarchicalFlexGridLib.MSHFlexGrid grdHuxing
Height = 3855
Left = 0
TabIndex = 0
Top = 2400
Width = 6735
_ExtentX = 11880
_ExtentY = 6800
_Version = 393216
_NumberOfBands = 1
_Band(0).Cols = 2
End
End
Attribute VB_Name = "frmBuildingstyleFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs_loupan As New ADODB.Recordset '楼盘
Dim rs_huxing As New ADODB.Recordset '户型
Private Sub cmdexit_Click()
Unload Me
End Sub
Private Sub cmdfind_Click()
On Error GoTo finderror
Dim sql As String
grdHuxing.Clear '显示查询结果前将表格中原有记录清除
If Option1.Value = True Then '选择户型编号作为
查询条件
sql = "select * from 户型资料表 where Hst_ID = '" & Trim(txthuxingnum.Text) & "'"
rs_huxing.CursorLocation = adUseClient
rs_huxing.Open sql, conn, adOpenKeyset, adLockPessimistic
setgrid
setgridhead
displaygrid
rs_huxing.Close
Exit Sub
End If
If Option2.Value = True Then '选择建筑面积作为查询条件
sql = "select * from 户型资料表 where Hst_buildarea between " & CInt(Trim(txtmianji1.Text)) & " and " & CInt(Trim(txtmianji2.Text))
rs_huxing.CursorLocation = adUseClient
rs_huxing.Open sql, conn, adOpenKeyset, adLockPessimistic
setgrid
setgridhead
displaygrid
rs_huxing.Close
Exit Sub
End If
If Option3.Value = True Then '选择户型结构作为查询条件
sql = "select * from 户型资料表 where Hst_type = '" & Trim(Combo1.Text) & "'"
rs_huxing.CursorLocation = adUseClient
rs_huxing.Open
sql, conn, adOpenKeyset, adLockPessi
mistic
setgrid
setgridhead
displaygrid
rs_huxing.Close
Exit Sub
End If
Exit Sub
finderror:
MsgBox Err.Description
End Sub
Private Sub cmdall_C