⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmbuildingstylefind.frm

📁 一个优秀的售楼系统,可供毕业生毕业设计参考
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Frmbuildingstylefind 
   BackColor       =   &H00C0FFFF&
   Caption         =   "户型查询"
   ClientHeight    =   7245
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   9285
   LinkTopic       =   "Form4"
   MaxButton       =   0   'False
   ScaleHeight     =   7245
   ScaleWidth      =   9285
   StartUpPosition =   2  '屏幕中心
   Begin VB.PictureBox gridhuxing 
      Height          =   4455
      Left            =   480
      ScaleHeight     =   4395
      ScaleWidth      =   8475
      TabIndex        =   10
      Top             =   2640
      Width           =   8535
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00C0FFFF&
      Caption         =   "查询条件"
      Height          =   2295
      Left            =   1080
      TabIndex        =   0
      Top             =   240
      Width           =   6855
      Begin VB.CommandButton cmdall 
         Caption         =   "所有"
         Height          =   375
         Left            =   2040
         TabIndex        =   12
         Top             =   1800
         Width           =   1215
      End
      Begin VB.CommandButton cmdexit 
         Caption         =   "退出"
         Height          =   375
         Left            =   3840
         TabIndex        =   11
         Top             =   1800
         Width           =   1335
      End
      Begin VB.CommandButton cmdfind 
         Caption         =   "查询"
         Height          =   375
         Left            =   240
         TabIndex        =   9
         Top             =   1800
         Width           =   1215
      End
      Begin VB.ComboBox Combo1 
         Height          =   315
         Left            =   1320
         Style           =   2  'Dropdown List
         TabIndex        =   8
         Top             =   1320
         Width           =   1335
      End
      Begin VB.TextBox txtmianji2 
         Height          =   375
         Left            =   3120
         TabIndex        =   6
         Top             =   840
         Width           =   1215
      End
      Begin VB.TextBox txtmianji1 
         Height          =   375
         Left            =   1320
         TabIndex        =   5
         Top             =   840
         Width           =   1335
      End
      Begin VB.TextBox txthuxingnum 
         Height          =   375
         Left            =   1320
         TabIndex        =   4
         Top             =   360
         Width           =   1335
      End
      Begin VB.OptionButton Option3 
         BackColor       =   &H00C0FFFF&
         Caption         =   "户型结构"
         Height          =   255
         Left            =   240
         TabIndex        =   3
         Top             =   1320
         Width           =   1215
      End
      Begin VB.OptionButton Option2 
         BackColor       =   &H00C0FFFF&
         Caption         =   "建筑面积"
         Height          =   255
         Left            =   240
         TabIndex        =   2
         Top             =   840
         Width           =   1455
      End
      Begin VB.OptionButton Option1 
         BackColor       =   &H00C0FFFF&
         Caption         =   "户型编号"
         Height          =   255
         Left            =   240
         TabIndex        =   1
         Top             =   360
         Width           =   1455
      End
      Begin VB.Label Label2 
         BackColor       =   &H00C0FFFF&
         Caption         =   "----"
         Height          =   375
         Left            =   2640
         TabIndex        =   13
         Top             =   960
         Width           =   495
      End
      Begin VB.Label Label1 
         BackColor       =   &H00C0FFFF&
         Caption         =   "平方米"
         Height          =   375
         Left            =   4440
         TabIndex        =   7
         Top             =   840
         Width           =   855
      End
   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
gridhuxing.Clear
If Option1.Value = True Then
   sql = "select * from 户型 where Hst_ID = '" & 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(txtmianji1.Text) & " and " & CInt(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 = '" & Combo1.Text & "'"
   rs_huxing.CursorLocation = adUseClient
   rs_huxing.Open sql, conn, adOpenKeyset, adLockPessimistic
   setgrid
   setgridhead
   displaygrid
   rs_huxing.Close
   Exit Sub
End If
Exit Sub
finderror:
   MsgBox Err.Description
End Sub

Private Sub cmdall_Click()
Dim sql As String
sql = "select * from 户型"
rs_huxing.CursorLocation = adUseClient
rs_huxing.Open sql, conn, adOpenKeyset, adLockPessimistic
Combo1.AddItem "二室二厅"
Combo1.AddItem "一室二厅"
Combo1.AddItem "一室二厅"
Combo1.AddItem "复    式"
Combo1.AddItem "三室二厅"
setgrid
setgridhead
displaygrid
rs_huxing.Close
End Sub

Private Sub Command3_Click()
Form_Load
End Sub

Private Sub Form_Load()
Dim sql As String
On Error GoTo loaderror
sql = "select * from 户型"
rs_huxing.CursorLocation = adUseClient
rs_huxing.Open sql, conn, adOpenKeyset, adLockPessimistic
Combo1.AddItem "二室二厅"
Combo1.AddItem "一室二厅"
Combo1.AddItem "一室二厅"
Combo1.AddItem "复    式"
Combo1.AddItem "三室二厅"
setgrid
setgridhead
displaygrid
rs_huxing.Close
Exit Sub
loaderror:
   MsgBox Err.Description
End Sub

Public Sub displaygrid()
Dim i As Integer
On Error GoTo displayerror
gridhuxing.Row = 0
If Not rs_huxing.EOF Then
   rs_huxing.MoveFirst
   Do While Not rs_huxing.EOF
            gridhuxing.Row = gridhuxing.Row + 1
            gridhuxing.Col = 0
            If Not IsNull(rs_huxing.Fields(0)) Then gridhuxing.Text = rs_huxing.Fields(0) _
                   Else gridhuxing.Text = ""
            gridhuxing.Col = 1
            If Not IsNull(rs_huxing.Fields(1)) Then gridhuxing.Text = rs_huxing.Fields(1) _
                   Else gridhuxing.Text = ""
            gridhuxing.Col = 2
            If Not IsNull(rs_huxing.Fields(2)) Then gridhuxing.Text = rs_huxing.Fields(2) _
                   Else gridhuxing.Text = ""
            gridhuxing.Col = 3
            gridhuxing.Text = CStr(CDbl(rs_huxing.Fields(1)) - CDbl(rs_huxing.Fields(2)))
            gridhuxing.Col = 4
            If Not IsNull(rs_huxing.Fields(3)) Then gridhuxing.Text = rs_huxing.Fields(3) _
                   Else gridhuxing.Text = ""
            gridhuxing.Col = 6
            If Not IsNull(rs_huxing.Fields(4)) Then gridhuxing.Text = rs_huxing.Fields(4) _
                   Else gridhuxing.Text = ""
            rs_huxing.MoveNext
   Loop
End If
displayerror:
If Err.Number <> 0 Then
   MsgBox Err.Description
End If
End Sub

Public Sub setgrid()
Dim i As Integer
On Error GoTo seterror
With gridhuxing
    .ScrollBars = flexScrollBarBoth
    .FixedCols = 1
    .Rows = rs_huxing.RecordCount + 1
    .Cols = 7
    .SelectionMode = flexSelectionByRow
For i = 0 To .Rows - 1
    .RowHeight(i) = 315
Next
For i = 0 To .Cols - 1
    .ColWidth(i) = 1300
Next i
End With
Exit Sub
seterror:
     MsgBox Err.Description
End Sub

Public Sub setgridhead()
On Error GoTo setheaderror
gridhuxing.Row = 0
gridhuxing.Col = 0
gridhuxing.Text = "户型编号"
gridhuxing.Col = 1
gridhuxing.Text = "建筑面积"
gridhuxing.Col = 2
gridhuxing.Text = "套内面积"
gridhuxing.Col = 3
gridhuxing.Text = "分摊面积"
gridhuxing.Col = 4
gridhuxing.Text = "户型"
gridhuxing.Col = 5
gridhuxing.Text = "图片"
gridhuxing.Col = 6
gridhuxing.Text = "户型简介"
Exit Sub
setheaderror:
   MsgBox Err.Description
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -