Hello, I have a field "MappedTo" in a subform "OldCodes" thats needs to refer to a field "NCodes" in the main form "NewCodes" based on whether a field in the subform "Decision" is checked or not. I would like it so when a user clicks the checkbox for "Decision", "MappedTo" is automatically updated with whatever the current "NCode" is in the main form. I can sorta do this by using
IIf([Decision]=-1,Forms!NewCodes![NCodes]," ")
as the control source for "MappedTo", but this gives me a problem. Each "old code" in the subform can possibly map to multiple "new codes" in the main form, but I would like the resulting value from the function to be the same throughout each record, and not recalculated each time it appears. Also I am having trouble storing this value in its underlying table.
In short, I need to know how to store a calculated if-then field to an underlying table, and for the calculation to only be performed on the actual click of the checkbox, not if a checkbox is already clicked or not.
I've messed around with several BeforeUpdate, AfterUpdate, and OnClick codes as well as trying to store in hidden textboxes, but keep getting errors. Please help, thanks to anyone who can.