DSum for textbox on Report only shows up after closing or compact/repair
<p>I have seven textboxes on a report that are populated by DSum using VBA. The correct values will only show up after doing a compact/repair or closing the database and reopening it.</p>

<p>I have tried turning off Compact on Close to see if that made a difference and it didn't. </p>

<p>I've put refresh and requery everywhere and still no luck.</p>

<p>I've adjusted the control source for txtLTL so that it looks for a simple value instead of the longer query, nothing.</p>

<p>I've manually set the control source, nothing. The reason for doing it in VBA is so that it's easier to replicate across all of our databases.</p>

<p>Here's the code:</p>

<pre><code>Me.txtUPS.ControlSource = "=DSum(""CCur(Shipping)"",""Orders"",""ShipMethod Like 'UPS%'"")"
Me.txtUSPS.ControlSource = "=DSum(""Shipping"",""Orders"",""ShipMethod Like 'USPS%'"")"
Me.txtFedEx.ControlSource = "=DSum(""Shipping"",""Orders"",""ShipMethod Like 'Fed%'"")"
Me.txtDHL.ControlSource = "=DSum(""Shipping"",""Orders"",""ShipMethod Like 'DHL%'"")"
Me.txtLTL.ControlSource = "=DSum(""Shipping"",""Orders"",""shipmethod not like 'UPS%' and shipmethod not like 'USPS%' and shipmethod not like 'fed%' and shipmethod not like 'DHL%' and shipmethod not like 'CPU' and shipmethod not like 'Courier' and shipping &gt; 0"")"
Me.txtCourier.ControlSource = "=DSum(""Shipping"",""Orders"",""ShipMethod Like 'Courier'"")"
Me.txtCPU.ControlSource = "=DSum(""Shipping"",""Orders"",""ShipMethod Like 'CPU'"")"
</code></pre>

<p>Here's the strange thing - txtLTL will populate with everything the first time the code runs but after closing and reopening, the correct textboxes will populate.</p>

<p>I'm completely at a loss now.</p>