title: VBA access run sql check row count
body: <p>I'm trying to display a field on a form depending on the results of an sql query.  Since I don't know vba in access I'm struggling and don't know where I am going wrong.  Help will be greatly appreciated.</p>
  
  <pre><code>Dim RecordSt As Recordset
  Dim dBase As Database
  Dim stringSQL As String
  
  Set dBase = CurrentDb()
  
  stringSQL = "SELECT * FROM Table1 WHERE ID = 2"
  
  DoCmd.RunSQL (stringSQL)
  
  If RecordSt.Fields.Count &gt; 0 Then
  Me.Other.Visible = True
  Else
  Me.Other.Visible = False
  End If
  </code></pre>