score:0

the easiest way to do this is to set the control source of the ActiveRecordNameTextBox to an expression. Experience tells me you probably tried this but had trouble referring to the subform. I always have to use areference when I refer to subforms. Here is a reference that also gives some explanation: https://www.fmsinc.com/tpapers/primer/index.html

if and only if is a natural choice for the expression given you want to select between two values. So if you want to refer to the subform controls use something like:

=IIf(IsNull(Forms!MainFormName![SubFormName].controls("BusinessNameTextBox")),Forms!MainFormName![SubFormName].controls("PrimaryContactTextBox"),Forms!MainFormName![SubFormName].controls("BusinessNameTextBox"))

You could also refer to the subform recordsource fields directly. Also when refering to a subform from the mainform you can use relative references to get:

=IIf(IsNull([SubFormName].[Form]![BusinessName]),[SubFormName].[Form]![PrimaryContact],[SubFormName].[Form]![BusinessName])

Note since you weren't explicit about the edge cases Like what to do if you have both a BusinessName and a PrimaryContact I just picked displaying the BusinessName if available and nothing if both where blank.


Related Query

More Query from same tag