<?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: in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/ado-help/m-p/348263#M77921</link>
    <description>thanks!  i'll try that.&lt;BR /&gt;
&lt;BR /&gt;
"Frank Oquendo" &lt;FRANKO&gt; wrote in message&lt;BR /&gt;
news:2651B20EA6F660A7FA545BC053E54954@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; If you're retrieving information on the selected client, why use a&lt;BR /&gt;
&amp;gt; loop at all? A properly formed SQL statement will allow you to select&lt;BR /&gt;
&amp;gt; just the one record. This will be a lot quicker and easier to debug:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; ' Let's assume you already have a connection 'cn'&lt;BR /&gt;
&amp;gt; Dim rs As ADODB.Recordset&lt;BR /&gt;
&amp;gt; Dim strSQL As String&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; strSQL = "SELECT * FROM ClientTable WHERE ClientID = " &amp;amp;&lt;BR /&gt;
&amp;gt; List1.ItemData(List1.ListIndex)&lt;BR /&gt;
&amp;gt; rs.Open strSQL, cn, adOpenForwardOnly, adLockReadOnly&lt;BR /&gt;
&amp;gt; If Not (rs.BOF And rs.EOF) Then&lt;BR /&gt;
&amp;gt;     ' You have a record, do your thing&lt;BR /&gt;
&amp;gt; End If&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Good judgment comes from experience.&lt;BR /&gt;
&amp;gt; Experience comes from bad judgment.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; http://www.acadx.com&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Rob Tomson" &lt;ROBT&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:678145EF8D38F9307CB1EF9563D31D20@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; i can't remove the second part....what i have is a list box of&lt;BR /&gt;
&amp;gt; clients and&lt;BR /&gt;
&amp;gt; &amp;gt; when i click on the client then it pulls info from a database and&lt;BR /&gt;
&amp;gt; popluates&lt;BR /&gt;
&amp;gt; &amp;gt; text boxes, etc.  if i remove the eof test then i'll get an error&lt;BR /&gt;
&amp;gt; when i&lt;BR /&gt;
&amp;gt; &amp;gt; create a new entry in the listbox&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/ROBT&gt;&lt;/FRANKO&gt;</description>
    <pubDate>Wed, 16 Jan 2002 12:17:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2002-01-16T12:17:50Z</dc:date>
    <item>
      <title>ADO help</title>
      <link>https://forums.autodesk.com/t5/vba-forum/ado-help/m-p/348259#M77917</link>
      <description>this isn't related to autocad but this group is the only reliable vb source&lt;BR /&gt;
i have.&lt;BR /&gt;
why do i get an eof error in this code?&lt;BR /&gt;
&lt;BR /&gt;
Do Until People.EOF Or People!Client = lstPeople.List(lstPeople.ListIndex)&lt;BR /&gt;
  People.MoveNext&lt;BR /&gt;
Loop&lt;BR /&gt;
&lt;BR /&gt;
shouldn't it just drop out if eof = true?  i've checked the value of&lt;BR /&gt;
people.eof and it is true but it won't drop out.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
please help,&lt;BR /&gt;
Rob</description>
      <pubDate>Wed, 16 Jan 2002 07:45:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/ado-help/m-p/348259#M77917</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-01-16T07:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: ADO help</title>
      <link>https://forums.autodesk.com/t5/vba-forum/ado-help/m-p/348260#M77918</link>
      <description>What happens if you remove the second part of your test?&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Good judgment comes from experience.&lt;BR /&gt;
Experience comes from bad judgment.&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadx.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Rob Tomson" &lt;ROBT&gt; wrote in message&lt;BR /&gt;
news:476F8B4CE9E69CD4AF82A43BF4A02491@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; this isn't related to autocad but this group is the only reliable vb&lt;BR /&gt;
source&lt;BR /&gt;
&amp;gt; i have.&lt;BR /&gt;
&amp;gt; why do i get an eof error in this code?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Do Until People.EOF Or People!Client =&lt;BR /&gt;
lstPeople.List(lstPeople.ListIndex)&lt;BR /&gt;
&amp;gt;   People.MoveNext&lt;BR /&gt;
&amp;gt; Loop&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; shouldn't it just drop out if eof = true?  i've checked the value of&lt;BR /&gt;
&amp;gt; people.eof and it is true but it won't drop out.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; please help,&lt;BR /&gt;
&amp;gt; Rob&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/ROBT&gt;</description>
      <pubDate>Wed, 16 Jan 2002 08:21:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/ado-help/m-p/348260#M77918</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-01-16T08:21:13Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/ado-help/m-p/348261#M77919</link>
      <description>i can't remove the second part....what i have is a list box of clients and&lt;BR /&gt;
when i click on the client then it pulls info from a database and popluates&lt;BR /&gt;
text boxes, etc.  if i remove the eof test then i'll get an error when i&lt;BR /&gt;
create a new entry in the listbox&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Frank Oquendo" &lt;FRANKO&gt; wrote in message&lt;BR /&gt;
news:AE21266E4291C27E96DCC02EF42A2B57@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; What happens if you remove the second part of your test?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Good judgment comes from experience.&lt;BR /&gt;
&amp;gt; Experience comes from bad judgment.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; http://www.acadx.com&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Rob Tomson" &lt;ROBT&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:476F8B4CE9E69CD4AF82A43BF4A02491@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; this isn't related to autocad but this group is the only reliable vb&lt;BR /&gt;
&amp;gt; source&lt;BR /&gt;
&amp;gt; &amp;gt; i have.&lt;BR /&gt;
&amp;gt; &amp;gt; why do i get an eof error in this code?&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Do Until People.EOF Or People!Client =&lt;BR /&gt;
&amp;gt; lstPeople.List(lstPeople.ListIndex)&lt;BR /&gt;
&amp;gt; &amp;gt;   People.MoveNext&lt;BR /&gt;
&amp;gt; &amp;gt; Loop&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; shouldn't it just drop out if eof = true?  i've checked the value of&lt;BR /&gt;
&amp;gt; &amp;gt; people.eof and it is true but it won't drop out.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; please help,&lt;BR /&gt;
&amp;gt; &amp;gt; Rob&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/ROBT&gt;&lt;/FRANKO&gt;</description>
      <pubDate>Wed, 16 Jan 2002 08:41:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/ado-help/m-p/348261#M77919</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-01-16T08:41:59Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/ado-help/m-p/348262#M77920</link>
      <description>If you're retrieving information on the selected client, why use a&lt;BR /&gt;
loop at all? A properly formed SQL statement will allow you to select&lt;BR /&gt;
just the one record. This will be a lot quicker and easier to debug:&lt;BR /&gt;
&lt;BR /&gt;
' Let's assume you already have a connection 'cn'&lt;BR /&gt;
Dim rs As ADODB.Recordset&lt;BR /&gt;
Dim strSQL As String&lt;BR /&gt;
&lt;BR /&gt;
strSQL = "SELECT * FROM ClientTable WHERE ClientID = " &amp;amp;&lt;BR /&gt;
List1.ItemData(List1.ListIndex)&lt;BR /&gt;
rs.Open strSQL, cn, adOpenForwardOnly, adLockReadOnly&lt;BR /&gt;
If Not (rs.BOF And rs.EOF) Then&lt;BR /&gt;
    ' You have a record, do your thing&lt;BR /&gt;
End If&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Good judgment comes from experience.&lt;BR /&gt;
Experience comes from bad judgment.&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadx.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Rob Tomson" &lt;ROBT&gt; wrote in message&lt;BR /&gt;
news:678145EF8D38F9307CB1EF9563D31D20@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; i can't remove the second part....what i have is a list box of&lt;BR /&gt;
clients and&lt;BR /&gt;
&amp;gt; when i click on the client then it pulls info from a database and&lt;BR /&gt;
popluates&lt;BR /&gt;
&amp;gt; text boxes, etc.  if i remove the eof test then i'll get an error&lt;BR /&gt;
when i&lt;BR /&gt;
&amp;gt; create a new entry in the listbox&lt;/ROBT&gt;</description>
      <pubDate>Wed, 16 Jan 2002 08:56:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/ado-help/m-p/348262#M77920</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-01-16T08:56:24Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/vba-forum/ado-help/m-p/348263#M77921</link>
      <description>thanks!  i'll try that.&lt;BR /&gt;
&lt;BR /&gt;
"Frank Oquendo" &lt;FRANKO&gt; wrote in message&lt;BR /&gt;
news:2651B20EA6F660A7FA545BC053E54954@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; If you're retrieving information on the selected client, why use a&lt;BR /&gt;
&amp;gt; loop at all? A properly formed SQL statement will allow you to select&lt;BR /&gt;
&amp;gt; just the one record. This will be a lot quicker and easier to debug:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; ' Let's assume you already have a connection 'cn'&lt;BR /&gt;
&amp;gt; Dim rs As ADODB.Recordset&lt;BR /&gt;
&amp;gt; Dim strSQL As String&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; strSQL = "SELECT * FROM ClientTable WHERE ClientID = " &amp;amp;&lt;BR /&gt;
&amp;gt; List1.ItemData(List1.ListIndex)&lt;BR /&gt;
&amp;gt; rs.Open strSQL, cn, adOpenForwardOnly, adLockReadOnly&lt;BR /&gt;
&amp;gt; If Not (rs.BOF And rs.EOF) Then&lt;BR /&gt;
&amp;gt;     ' You have a record, do your thing&lt;BR /&gt;
&amp;gt; End If&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; Good judgment comes from experience.&lt;BR /&gt;
&amp;gt; Experience comes from bad judgment.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; http://www.acadx.com&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "Rob Tomson" &lt;ROBT&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:678145EF8D38F9307CB1EF9563D31D20@in.WebX.maYIadrTaRb...&lt;BR /&gt;
&amp;gt; &amp;gt; i can't remove the second part....what i have is a list box of&lt;BR /&gt;
&amp;gt; clients and&lt;BR /&gt;
&amp;gt; &amp;gt; when i click on the client then it pulls info from a database and&lt;BR /&gt;
&amp;gt; popluates&lt;BR /&gt;
&amp;gt; &amp;gt; text boxes, etc.  if i remove the eof test then i'll get an error&lt;BR /&gt;
&amp;gt; when i&lt;BR /&gt;
&amp;gt; &amp;gt; create a new entry in the listbox&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/ROBT&gt;&lt;/FRANKO&gt;</description>
      <pubDate>Wed, 16 Jan 2002 12:17:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/ado-help/m-p/348263#M77921</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-01-16T12:17:50Z</dc:date>
    </item>
  </channel>
</rss>

