title: Retrospectively populate an access form field
body: <p>I have an access database that I have been asked to add a field to (KeyStage). This field will auto populate from the NCY field that is already known and populated.  The code for this is;</p>
  
  <pre><code>Dim KeyStage As String
  Dim NCY As Integer
  
  NCY = Me.NationalCurriculumYear.Value
  
  If NCY &lt; 1 Then
  Me.KeyStage = "Early Years"
  ElseIf NCY &gt; 0 And NCY &lt; 3 Then
  Me.KeyStage = "KS1"
  ElseIf NCY &gt; 2 And NCY &lt; 7 Then
  Me.KeyStage = "KS2"
  ElseIf NCY &gt; 6 And NCY &lt; 10 Then
  Me.KeyStage = "KS3"
  ElseIf NCY &gt; 9 And NCY &lt; 12 Then
  Me.KeyStage = "KS4"
  Else: Me.KeyStage = "Left School"
  End If
  </code></pre>
  
  <p>If I put this into a GotFocus sub, it works fine.  The problem is I already have 2000 records and unless I tab through each record, I can't get the KeyStage field to auto populate.  I tried putting it in an onLoad sub for the form but that didn't work either.  Can anyone suggest how I would approach this?</p>
  
  <p>Thank you in advance for your help.</p>