GISCafe
   >> GIS Education
Thread views: 28882 View all threadsNext thread*

airickjay
(Stranger )
07/10/07 06:38 AM
Re: Labeling issue [re: Waukegan]Report this article as Inappropriate to us !!!Login to Reply

This is the solution I came up with, it's not pretty but it did get my parcels labeled with the multiple numbers. 

Function FindLabel ( [parcels.OBJECTID] )

Dim strPrclQry, strinfo, LeaseNo

'form query string
strPrclQry = "SELECT DISTINCT LEASE_N FROM GROUPS WHERE GROUPS.PARCEL_N =  " & [parcels.OBJECTID] & " ORDER BY LEASE_N DESC" 'Your query will differ

Dim ADOConn
set ADOConn = CreateObject("ADODB.Connection")
Dim rsPrcl
set rsPrcl = CreateObject("ADODB.Recordset")

ADOConn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=DatabaseLocation"

ADOConn.CursorLocation = 3

rsPrcl.Open strPrclQry, ADOConn, 3, 1, 1

'if no record is found, return empty string

Select Case rsPrcl.RecordCount
   Case -1, 0
      strInfo = " "
   Case 1
      'reading only the first record

      LeaseNum = rsPrcl.Fields("LEASE_N").Value
      strInfo = Right (LeaseNum, 4) + strInfo
      

   Case Else

      for I = 1 to rsPrcl.RecordCount
            if I <> 1 then
               strInfo = vbNewLine + strInfo
            end if

            LeaseNum = rsPrcl.Fields("LEASE_N").Value
            strInfo = Right (LeaseNum, 4) + strInfo
            rsPrcl.Movenext
      Next

End Select

'closing connections - this is a must

rsPrcl.Close
ADOConn.Close
Set rsPrcl = Nothing
Set ADOConn = Nothing

  FindLabel = strInfo
End Function






Entire thread
SubjectPosted byPosted on
*Labeling issue airickjay   06/20/07 06:40 AM
.*Re: Labeling issue bihodge   06/21/07 11:10 AM
.*Re: Labeling issue airickjay   06/25/07 06:05 AM
.*Re: Labeling issue Waukegan   07/10/07 06:31 AM
.*Re: Labeling issue airickjay   07/10/07 06:38 AM
.*Re: Labeling issue jgarner   06/21/07 08:06 AM
Jump to

 

Trimble
Teledyne Optech
CADalog.com - Countless CAD add-ons, plug-ins and more.



Internet Business Systems © 2016 Internet Business Systems, Inc.
595 Millich Dr., Suite 216, Campbell, CA 95008
+1 (408)-337-6870 — Contact Us, or visit our other sites:
AECCafe - Architectural Design and Engineering EDACafe - Electronic Design Automation TechJobsCafe - Technical Jobs and Resumes  MCADCafe - Mechanical Design and Engineering ShareCG - Share Computer Graphic (CG) Animation, 3D Art and 3D Models
  Privacy Policy