title: Count Records X of Y across Records on Form
body: <p>I have a Form with fields StudentID, StartDate, TxDate (Treatment Date) among c.60 other fields.
  There is a Go To Student drop-down box in the Form's Header that establishes a subset for the StudentID selected records only when a particular StudentID is selected from the drop-down.</p>
  
  <p>There are buttons to click to First, Previous, Next, Last</p>
  
  <p>I want to show on the Form, as you click First, Previous, Next, or Last, and go to the Next record, the number record for that individual StudentID.  That is, if the Student had 6 records, it would display 1 of 6 for their first record, 2 of 6 for the Next, 3 of 6 for the Next....</p>
  
  <p>I've tried things like DCount('RecordNo","Depression Form Query","Student") which counts all the records in the Data Table, not just the individual StudentID's.</p>
  
  <p>I used an Autonumber in the Students Table but it generates a number equivalent to the StudentID being the 3rd Student entered, not a count of their Treatment Dates.</p>
  
  <p>I've tried various loopings I've found on the net but they do not count across records for the same Student.</p>
  
  <p>I made an X of Y Report which I then dragged and dropped into the Form.  It generates the correct Y (6) but an incorrect X.</p>
  
  <p>[<img src="https://i.stack.imgur.com/7nLWg.png" alt="enter image description here">]</p>
  
  <p>The Depression Form Query is based on the Students Table and the Depression Table.</p>