<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Difficulty with Query filter WhereClause using different fields in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/difficulty-with-query-filter-whereclause-using/m-p/21719#M524</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That did it, thanks a ton! I think I tried every variation trying to get this thing to work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Jul 2010 21:06:42 GMT</pubDate>
    <dc:creator>deleted-user-h2MwrUDd3vgt</dc:creator>
    <dc:date>2010-07-22T21:06:42Z</dc:date>
    <item>
      <title>Difficulty with Query filter WhereClause using different fields</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/difficulty-with-query-filter-whereclause-using/m-p/21717#M522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to create a query filter in order to guarantee that a user doesn't use the same value twice but am having difficulty creating a WhereClause that evaluates two different fields. I'm able to get it to work using one field, but when I add the second clause I get the following compile error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Type-declaration character does not match declared data type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would appreciate any ideas as to how to fix this error, or any suggestions as to how I could accomplish the same task a different way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Public Sub DuplicateEntry()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pMxDoc As IMxDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pMap As IMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pMxDoc = ThisDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pMap = pMxDoc.FocusMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pFLayer As IFeatureLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pFLayer = pMap.Layer(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pFClass As IFeatureClass&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pFClass = pFLayer.FeatureClass&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;' query filter to test to see if the input value already exists&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pQf As IQueryFilter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pQf = New QueryFilter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pQf.WhereClause = "PHOTO_NO = " &amp;amp; frmRamp.txtPhoto.Text&amp;amp; And "WARD =" &amp;amp; frmRamp.txtWard.Text&amp;amp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;' if it exists show message&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If pFClass.FeatureCount(pQf) &amp;gt; 0 Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; MsgBox "Value already exists, try again!", vbOKOnly, "Forum Help"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; frmRamp.Hide&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; frmRamp.Show&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Exit Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jul 2010 19:48:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/difficulty-with-query-filter-whereclause-using/m-p/21717#M522</guid>
      <dc:creator>deleted-user-h2MwrUDd3vgt</dc:creator>
      <dc:date>2010-07-22T19:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty with Query filter WhereClause using different fields</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/difficulty-with-query-filter-whereclause-using/m-p/21718#M523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You have your quotes in the wrong place. Try this for your whereclause:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pQf.WhereClause = "PHOTO_NO = " &amp;amp; frmRamp.txtPhoto.Text &amp;amp; " And WARD =" &amp;amp; frmRamp.txtWard.Text&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jul 2010 20:35:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/difficulty-with-query-filter-whereclause-using/m-p/21718#M523</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2010-07-22T20:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty with Query filter WhereClause using different fields</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/difficulty-with-query-filter-whereclause-using/m-p/21719#M524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That did it, thanks a ton! I think I tried every variation trying to get this thing to work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jul 2010 21:06:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/difficulty-with-query-filter-whereclause-using/m-p/21719#M524</guid>
      <dc:creator>deleted-user-h2MwrUDd3vgt</dc:creator>
      <dc:date>2010-07-22T21:06:42Z</dc:date>
    </item>
  </channel>
</rss>

