How to retrieve values from a DAO recordset dynamically?
<p>I have a DAO recordset such as</p>

<pre><code>    Set rst = CurrentDb.OpenRecordset("Select * from EMPLOYEES")
</code></pre>

<p>The recordset has following fields - NAME, AGE, SALARY, TITLE</p>

<p>Now I have created an array with a certain list of fields -</p>

<pre><code>     Dim Fields As Variant
     Fields = Array("NAME", "SALARY")
</code></pre>

<p>And want to retrieve the fields from the recordset dynamically using the array elements </p>

<pre><code>     rst.MoveNext

     MsgBox(rst![Array(0)])
</code></pre>

<p>I get an error stating 'Item not found in the collection'. </p>

<p>I know what I am missing here is the proper way to pass the variable for the Field Name after the exclamation ('!') sign but I can't figure out how. Can anyone help?  </p>