You are using a subform in datasheet view, right? You need to manually open the subform using the little [+].
Before you click it, there is no subform. So the expression is really invalid, no way around that.
Once you have opened a subform, it will work, but not necessarily the way you wish. Several subform instances can be opened by clicking on several [+] symbols. Which subform will be active in that case?
If you need to retrieve information from the subform on the main form, do not use the datasheet view.
(°v°)