I’m creating a MS Access 2010 database to allow users enter series of data which would be used in a query.
I have a Main form named “Entry” and a bounded subform named “SubEntry” (used to view the entered records).
The main form (Entry) consists of text/combo box controls that allows users to key in values, such as:
**Controls ControlSource**
Date "Entered by the user"
CompanyID "Entered by the user"
TicketID "Entered by the user"
TicketPrice "Automatic retrieved by a query based on the entered 'Date' and 'TicketID' "
Pieces "Entered by the user"
TotalPrice "TicketPrice * Pieces"
CorrectedPrice "Entered by the User"
Revenue "=IIf([CorrectPrice]=0,[TotalPrice],[CorrectPrice])"
This works fine with entering and viewing record-sets. But the problem is, at the initial stage when the user adds recordset to the subform, the exact “Revenue” value is added to the subform’s “Revenue” field. But after then, when the user scrolls in the subfrom and chooses a recordset (which appears in the main form’s respective controls) and changes the values. For instance chooses another ticketID or Date, the “Revenue” value in the main form changes but not updated in Subform’s Revenue field. Meanwhile anyother changes made main form automatically updates in the subform but not that of the “Revenue” value.
I’m not that conversant with MS Access nor VBA, just wondering if there is something obvious that is missing? How to deal with the SubEntry’s “Revenue” field to automatically updates like any other fields in the subform does.
Thanks for your time and assistance.
You need to associate the textbox with the relevant field in the subform, so:
Then you need code to add the calculation, for example:
Put similar code in any control should change the value of txtEinnahme.