title: Making "DoCmd.GoToRecord" function work on a subform
body: <p>I have been using the function <code>DoCmd.GoToRecord , , acNewRec</code> successfully for creating and moving to a new record within a subform (with a table as the source).  However, when I try to do the same from the parent form, this does not work.  I have tried different approaches, including:</p>
  
  <pre><code>Me.sbfrm_subform.Controls("ctrName").SetFocus
  DoCmd.GoToRecord , , acNewRec
  </code></pre>
  
  <p>which only sets the focus on the control (ctrName), but fails to add and go to a new record, or</p>
  
  <pre><code>DoCmd.GoToRecord acDataForm, Me.sbfrm_subform.Form.Name, acLast
  </code></pre>
  
  <p>Which returns the runtime error 2489, "The object 'sbfrm_subform is nt open."</p>