title: DoCmd.Open Does not load my onload criteria in Acces 2016
body: <p>I am opening a form in VBA with the command DoCmd.OpenForm, but when the form opens it is not loading my onload criteria.
  When I open the form in any different way it does load the onload criteria set in VBA.
  What am I doing wrong?</p>
  
  
  
  <p>I open the form with:</p>
  
  <pre class="lang-vb prettyprint-override"><code>DoCmd.OpenForm "frmOrder", acNormal, "", "", , acNormal
  </code></pre>
  
  <p>And when the form opens it needs to do the following on On Load:</p>
  
  <pre class="lang-vb prettyprint-override"><code>If Me.POOrderFreeEntry = True Then
      Me.frmOrderDetails.visible = True
      Me.frmOrderDetailsFreeEntry.visible = True
      Me.frmOrderDetailsLarge.visible = False
      Me.frmOrderDetails.Requery
  Else
      Me.frmOrderDetails.visible = False
      Me.frmOrderDetailsFreeEntry.visible = False
      Me.frmOrderDetailsLarge.visible = True
      Me.frmOrderDetailsLarge.Requery
  End If
  </code></pre>
  
  <p>However it only works if I open the form with a Macro or any other way.
  With the DoCmd.OpenForm it is not using the Criteria</p>