Reputation:
I have two forms: frmReceipts and frmDiffs. frmReceipts has an unbound control that shows the result of this function:
Public Function RecDiffs() As Double
RecDiffs = Forms!frmDiffs.Text17
End Function
At the moment the value of Text17 is 54.00 but when frmReceipts opens it shows the value 0.00 on control Text41. I can correct this by clicking a command button that runs Me.Form.Refresh
Refresh does not work (i.e. Text17 continues to show 0.00) if Refresh runs On Load, On Open, or On Activate. It only seems to work by clicking the command button. Ideally I'd like the correct value to show in Text17 simply when the form opens. Also, If I put frmReceipts into Design mode then back into Form View, Text17 then shows the correct data.
Upvotes: 0
Views: 60
Reputation:
Stumbled across the answer: frmDiffs sorts records by 'ClientName'. Deleting that procedure solved the problem entirely. It might have been caused by the fact that at the moment there is only one record. Cisco had suggested I upload the database. I was deleting certain data prior to upload. This caused an error message relating to the OrderBy procedure, which I then deleted.
Upvotes: 0
Reputation: 251
define the Control Source of the unbound control in frmReceipts equal to
Control Source: =[Forms]![Form2]![Text0]
It will show the correct value.
You can also define your control as
enabled: false
locked: True
I checked your code (MS Access 2013) and it runs well, but if Text17 contains a string, you can have a conversion problem in your function.
Upvotes: 0