Access VBA - Open Form to Specific Record from Report
<p>I have a report that lists Deposits, with the DepositID set as a hyperlink.  OnClick of DepositID, it opens the Deposit Entry form to that particular record.  However, the form opens to a new record instead of the one the user clicks on.  I think it is because I have another bit of code that runs OnLoad of the form that goes to a new record, and it might be executing that after executing the OnClick code.</p>

<p>OnClick of DepositID from the report:</p>

<pre><code>DoCmd.OpenForm "DepositForm", acNormal, "", "[DepositID]= " &amp; [DepositID]
</code></pre>

<p>OnLoad of the Form:</p>

<pre><code>DoCmd.GoToRecord , , acNewRec
</code></pre>

<p>Is the OnLoad code running after the OnClick code, and effectively not showing the specified record from the report?  Not sure how to fix.</p>