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

📄 findcustomize_else.frm

📁 这是我的一个课题:我省农业分布调查咨询系统。课题是和省农业厅合作的。源代码完整
💻 FRM
📖 第 1 页 / 共 4 页
字号:
                  Label4.Caption = "人"
                Else
                    If FindFieldCombo.Text = "国内生产总值" Or FindFieldCombo.Text = "第一产业产值" Or FindFieldCombo.Text = "第二产业产值" Or FindFieldCombo.Text = "第三产业产值" Or FindFieldCombo.Text = "种植业产值" Or FindFieldCombo.Text = "牧业产值" Or FindFieldCombo.Text = "林业产值" Or FindFieldCombo.Text = "乡镇企业产值" Then
                       Label4.Caption = "万元"
                    Else
                       Label4.Caption = ""
                    End If
                End If
             End If
          End If
       End If
    End If
End If
End Sub

Private Sub FindFieldCombo_LostFocus()
'Select Case FindFieldCombo.Text
'       Case "县名", "行政代码", "邮政编码"
'       selectyearCombo1.Enabled = True
'       Checkequal.Enabled = True
'       Checkequal.Value = 1
'       Frame2.Enabled = False
'       Optionmore.Enabled = False
'       Optionless.Enabled = False
'
'       Case "土地面积"
'       selectyearCombo1.Enabled = False
'       Checkequal.Enabled = True
'       Checkequal.Value = 1
'       Frame2.Enabled = True
'       Optionmore.Enabled = True
'       Optionless.Enabled = True
'
'       Case "播种面积", "耕地面积", "县总人口", "非农业人口", "农村人口", "男性人口", "女性人口", "从业人员", "农民人均纯收入", "粮食总产", "国内生产总值", "第一产业产值", "第二产业产值", "第三产业产值", "种植业产值", "牧业产值", "林业产值", "乡镇企业产值"
'       selectyearCombo1.Enabled = True
'       Checkequal.Enabled = True
'       Checkequal.Value = 1
'       Frame2.Enabled = True
'       Optionmore.Enabled = True
'       Optionless.Enabled = True
'End Select
'If FindFieldCombo.Text = "土地面积" Then
'   Label4.Caption = "平方公里"
'Else
'   If FindFieldCombo.Text = "播种面积" Or FindFieldCombo.Text = "耕地面积" Then
'      Label4.Caption = "亩"
'   Else
'      If FindFieldCombo.Text = "农民人均纯收入" Then
'         Label4.Caption = "元"
'      Else
'         If FindFieldCombo.Text = "粮食总产" Then
'            Label4.Caption = "吨"
'         Else
'            If FindFieldCombo.Text = "非农业人口" Then
'               Label4.Caption = "万人"
'            Else
'                If FindFieldCombo.Text = "县总人口" Or FindFieldCombo.Text = "农村人口" Or FindFieldCombo.Text = "男性人口" Or FindFieldCombo.Text = "女性人口" Or FindFieldCombo.Text = "从业人员" Then
'                  Label4.Caption = "人"
'                Else
'                    If FindFieldCombo.Text = "国内生产总值" Or FindFieldCombo.Text = "第一产业产值" Or FindFieldCombo.Text = "第二产业产值" Or FindFieldCombo.Text = "第三产业产值" Or FindFieldCombo.Text = "种植业产值" Or FindFieldCombo.Text = "牧业产值" Or FindFieldCombo.Text = "林业产值" Or FindFieldCombo.Text = "乡镇企业产值" Then
'                       Label4.Caption = "万元"
'                    Else
'                       Label4.Caption = ""
'                    End If
'                End If
'             End If
'          End If
'       End If
'    End If
'End If

End Sub

Private Sub FindValueText_Change()
'If FindValueText.Text = "" Then
'   OKButton.Enabled = False
'Else
'   OKButton.Enabled = True
'End If

End Sub

Private Sub Form_Load()
Dim ds As Dataset
Dim myfeatures As Features
Dim myfeature As Feature
Dim rvs             As MapXLib.RowValues
Dim rv              As MapXLib.RowValue
Dim lyr   As Layer

'/*以下为FindFieldCombo赋值*/
FindFieldCombo.Clear
FindValueText.Text = ""
FindFieldCombo.AddItem "不选类别"
FindFieldCombo.AddItem "县名"   '字符型
FindFieldCombo.AddItem "行政代码" '字符型
FindFieldCombo.AddItem "邮政编码" '字符型
FindFieldCombo.AddItem "土地面积" '数字型
FindFieldCombo.AddItem "播种面积" '数字型
FindFieldCombo.AddItem "耕地面积" '数字型
FindFieldCombo.AddItem "县总人口" '数字型
FindFieldCombo.AddItem "非农业人口" '数字型
FindFieldCombo.AddItem "农村人口"   '数字型
FindFieldCombo.AddItem "男性人口" '数字型
FindFieldCombo.AddItem "女性人口" '数字型
FindFieldCombo.AddItem "从业人员" '数字型
FindFieldCombo.AddItem "农民人均纯收入" '数字型
FindFieldCombo.AddItem "粮食总产" '数字型
FindFieldCombo.AddItem "国内生产总值" '数字型
FindFieldCombo.AddItem "第一产业产值" '数字型
FindFieldCombo.AddItem "第二产业产值" '数字型
FindFieldCombo.AddItem "第三产业产值" '数字型
FindFieldCombo.AddItem "种植业产值" '数字型
FindFieldCombo.AddItem "牧业产值" '数字型
FindFieldCombo.AddItem "林业产值" '数字型
FindFieldCombo.AddItem "乡镇企业产值" '数字型
FindFieldCombo.ListIndex = 0 '不选类别
'/*以下为seelctAreatypeCombo1赋值*/

If fMainForm.Map1.Layers.Item("a-地貌").Visible = True Then
   Set ds = fMainForm.Map1.Datasets.Item("a-dm")
   FindCustomize_else.Caption = "四川省地貌区划图查询窗口"
   FindCustomize_else.Label3.Caption = "请选择您想查询的地貌类型"
End If
If fMainForm.Map1.Layers.Item("a-气候").Visible = True Then
   Set ds = fMainForm.Map1.Datasets.Item("a-qh")
   FindCustomize_else.Caption = "四川省农业气候区划图查询窗口"
   FindCustomize_else.Label3.Caption = "请选择您想查询的气候类型"

End If
If fMainForm.Map1.Layers.Item("a-水利").Visible = True Then
   Set ds = fMainForm.Map1.Datasets.Item("a-sl")
   FindCustomize_else.Caption = "四川省水利区划图查询窗口"
   FindCustomize_else.Label3.Caption = "请选择您想查询的水利类型"
End If
If fMainForm.Map1.Layers.Item("a-水文").Visible = True Then
   Set ds = fMainForm.Map1.Datasets.Item("a-sw")
   FindCustomize_else.Caption = "四川省农业水文地质区划图查询窗口"
   FindCustomize_else.Label3.Caption = "请选择您想查询的水文类型"
End If
If fMainForm.Map1.Layers.Item("a-企业").Visible = True Then
   Set ds = fMainForm.Map1.Datasets.Item("a-qy")
   FindCustomize_else.Caption = "四川省乡镇企业区划图查询窗口"
   FindCustomize_else.Label3.Caption = "请选择您想查询的乡镇企业类型"
End If
If fMainForm.Map1.Layers.Item("a-畜牧").Visible = True Then
   Set ds = fMainForm.Map1.Datasets.Item("a-xm")
   FindCustomize_else.Caption = "四川省畜牧业区划图查询窗口"
   FindCustomize_else.Label3.Caption = "请选择您想查询的畜牧业类型"
End If
If fMainForm.Map1.Layers.Item("a-渔业").Visible = True Then
   Set ds = fMainForm.Map1.Datasets.Item("a-yy")
   FindCustomize_else.Caption = "四川省渔业区划图查询窗口"
   FindCustomize_else.Label3.Caption = "请选择您想查询的渔业类型"
End If
If fMainForm.Map1.Layers.Item("a-种植业").Visible = True Then
   Set ds = fMainForm.Map1.Datasets.Item("a-zz")
   FindCustomize_else.Caption = "四川省种植业区划图查询窗口"
   FindCustomize_else.Label3.Caption = "请选择您想查询的种植业类型"
End If
If fMainForm.Map1.Layers.Item("a-综农").Visible = True Then
   Set ds = fMainForm.Map1.Datasets.Item("a-zl")
   FindCustomize_else.Caption = "四川省综合农业区划图查询窗口"
   FindCustomize_else.Label3.Caption = "请选择您想查询的综合农业类型"
End If
Set lyr = ds.Layer
'Set myfeatures = fMainForm.Map1.Layers.Item("a-地貌").AllFeatures
Set myfeatures = lyr.AllFeatures
For Each myfeature In myfeatures
    Set rvs = ds.RowValues(myfeature)
    selectAreatypeCombo1.AddItem rvs.Item("说明").Value
Next
selectAreatypeCombo1.ListIndex = 0

selectyearCombo1.AddItem "1999"
selectyearCombo1.ListIndex = 0

End Sub

Private Sub Form_Unload(Cancel As Integer)
Dim i As Integer
For i = 1 To fMainForm.Map1.Datasets.Count
    If fMainForm.Map1.Datasets.Item(i).Name = "1g12_year" Then
        fMainForm.Map1.Datasets.Remove ("1g12_year")
        Exit For
    End If
Next
End Sub

Private Sub OKButton_Click()
    FindCustomize_else.MousePointer = ccHourglass '设置鼠标为沙漏形
 
  '/**********选择模糊查询************/
    
    Dim FindValue As Variant                                      '查询值变量
    Dim FindYear As Variant                                       '所选年份变量
    Dim FoundFeatures As Features                                 '查询结果地物集
    Dim var As New MapXLib.Variables                              'SQL语句的查询变量集
    Dim mytext As String
    Dim i As Integer
    Dim db As Database
    Dim myrs As ADODB.Recordset
    Dim FoundFeatures_aa As Features    '定义查找的被包含在aa中某个feature的属于1g12的features集合
    Dim mysearchwithinfeature As Feature '为使用layer.searchwithinfeature定义feature
    Dim var_aa As New MapXLib.Variables
    Dim FoundFeatures_last As Features   '定义最终得到的features集合
    Dim lyr As Layer
    
    ProBar1.Min = 0
    ProBar1.Value = 0
    ProBar1.Max = 100
     var_aa.Add "vValue_aa", selectAreatypeCombo1.Text

     If FindFieldCombo.Text = "不选类别" Then
        ProBar1.Visible = True
        mytext = ""
     Else
        If FindFieldCombo.Text = "县名" Or FindFieldCombo.Text = "行政代码" Or FindFieldCombo.Text = "邮政编码" Then '针对字符型字段进行模糊查询,选择年份后可查看某年的数据
            ProBar1.Visible = True
            var.Add "vValue", "%" & FindValueText.Text & "%"
            mytext = "而且" & FindFieldCombo.Text & "等于" & FindValueText.Text
        Else '针对数字型字段
            If Optionmore.Value = False And Optionless.Value = False And Checkequal.Value = 0 Then
                MsgBox "请选择运算符号!", , "提示信息"
                FindCustomize.MousePointer = ccDefault
                Exit Sub
            End If
            ProBar1.Visible = True
            On Error GoTo NumError
            FindValue = CDbl(FindValueText.Text)
            On Error Resume Next
            var.Add "vValue", FindValue
             '/*以下是为frmselectmore的label1的caption准备*/
            If FindFieldCombo.Text = "土地面积" Then   '土地面积应与年份无关
                If Optionmore.Value = True And Checkequal.Value = 0 Then
                   mytext = "而且" & FindFieldCombo.Text & "大于" & FindValueText.Text & Label4.Caption
                End If
                If Optionmore.Value = True And Checkequal.Value = 1 Then

⌨️ 快捷键说明

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