maybe obvious, but the 2 styles of references do not evaluate the same way.
! will provide late bound reference to the name that follows it and pass it to what comes before it. Thus fieldName (no quotes) can be evaluated.
. (as in subFormName.FieldName) is explicit and will evaluate upon code compile whereas ! will not. Thus misspell control name with ! and it will not blow up until that code line executes.
Now for the other method (at least I'm fairly certain of this next part)
It requires a delimited name value be passed to the Controls collection (a reference to that collection is invoked by Controls), which you are not delimiting unless you have
subFormName.Fields( & "'" & varFieldName & "'")
I made single quotes red and larger so as to be seen as surrounding varFieldName with ' You can also use doubles but it's a bit funkier to do so.
Using subFormName(varFieldName) you avoid using the Controls collection. However, your variable name suggests it is a variant, which will be a problem if any situation returns any other data type other than text. I cannot recall seeing the actual version that you say works, so I cannot comment on either its efficiency or safety.
BTW - Value isn't needed for what you show as it's the default property of a text or combo box. An exception could be where lookup fields are being used, but you don't use those, right?
Hope some of that helps.
Last edited by Micron; 06-26-2019 at 03:05 PM.
Reason: clarification & added info
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.