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

📄 assignrepres.frm

📁 GIS地理信息系统开发。大名鼎鼎的MAPX+VisualBasic6.0软件开发
💻 FRM
字号:
VERSION 5.00
Begin VB.Form AssignRepres 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Assign sales representative"
   ClientHeight    =   1605
   ClientLeft      =   2370
   ClientTop       =   2445
   ClientWidth     =   4155
   Icon            =   "AssignRepres.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   1605
   ScaleWidth      =   4155
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton cmdOk 
      Caption         =   "&OK"
      Default         =   -1  'True
      Height          =   375
      Left            =   720
      TabIndex        =   3
      Top             =   1080
      Width           =   1215
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "&Cancel"
      Height          =   375
      Left            =   2160
      TabIndex        =   2
      Top             =   1080
      Width           =   1215
   End
   Begin VB.ComboBox cmbRepres 
      Height          =   315
      ItemData        =   "AssignRepres.frx":000C
      Left            =   1500
      List            =   "AssignRepres.frx":0022
      Style           =   2  'Dropdown List
      TabIndex        =   1
      Top             =   300
      Width           =   2355
   End
   Begin VB.Label lblName 
      Caption         =   "&Representative:"
      Height          =   255
      Left            =   180
      TabIndex        =   0
      Top             =   360
      Width           =   1275
   End
End
Attribute VB_Name = "AssignRepres"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

' This sample application and corresponding sample code is provided
' for example purposes only.  It has not undergone rigorous testing
' and as such should not be shipped as part of a final application
' without extensive testing on the part of the organization releasing
' the end-user product.

Dim dataRep As Data, CurSel As MapXLib.Selection, DataSetRep As MapXLib.Dataset
Dim bSet As Boolean

Public Sub Activate(dataReps As Data, sel As MapXLib.Selection, DataSetReps As MapXLib.Dataset)
  Set dataRep = dataReps
  Set CurSel = sel
  Set DataSetRep = DataSetReps
  
  If Not bSet Then
    cmbRepres.ListIndex = 0
    bSet = True
  End If

  FormToCenter hWnd
  Show 1
End Sub

Private Sub cmdCancel_Click()
  Hide
End Sub

Private Sub cmdOk_Click()
  Dim sRepres As String, rs As Recordset, rs2 As Recordset, sFilter As String, sep As String
  Dim sel As Feature

  sRepres = cmbRepres.List(cmbRepres.ListIndex)
  
  Hide
  
  Set rs = dataRep.Recordset.OpenRecordset(dbOpenDynaset)
  sFilter = "Ucase(STATE) IN("
  sep = ""
  For Each sel In CurSel
    sFilter = sFilter & sep & "'" & sel.Name & "'"
    sep = ","
  Next
  If sep = "" Then
    Exit Sub
  Else
    sFilter = sFilter & ")"
  End If
  rs.FindFirst sFilter
  Do While Not rs.NoMatch
    rs.Edit
    rs.Fields(2).Value = sRepres
    rs.Update
    rs.FindNext sFilter
  Loop
  Set dataRep.Recordset = rs
  rs.Close
  dataRep.Refresh
  DataSetRep.Refresh
End Sub

Private Sub Form_Load()
  bSet = False
End Sub

⌨️ 快捷键说明

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