I have a database with a snapshot type continuous form (let's call it frmC) whose record source is a query with multiple tables, plus another dynaset type modal form (let's call it frmE) that allows to edit the part of frmC information that comes from a single table. As a simplified example, imagine frmC contains ProductCost from tblProducts, OrderQty from tblOrders, while frmE allows for editing of ProductCost only and has record source tblProducts only. A button in frmC opens frmE with WHERE = the selected record in frmC.
Inside frmE, I wish to also display information from frmC, and use that information for temporary calculations that do not need to be stored (again, simplifying imagine that when increasing ProductCost I want the user to be able to see what the total impact of the increase would be considering the OrderQty).
At the moment I have come up with two different ways to accomplish this:
- Adding an unbound locked control in frmE (e.g. txtOrderID) and using a macro connected to the button in frmC to SetValue frmE!txtOrderID=frmC!OrderQty
- Adding a bound locked control in frmE, with source frmC!OrderQty
These both work fine, but I am wondering if either is a better choice or if there is any potential issue with any of these that I have not thought about.
As a note, the reason frmE's record source is not the same query as frmC but rather a single table is because I'm following a suggestion to avoid keeping a dynaset type connection open to multiple tables when, such as this case, it is not strictly necessary for data input. If you disagree, I would love to hear more about it.