N
nybaseball22
Hello,
I am trying to make a subform that opens on a main form. The code
works when I open the subform, but when the subform opens on the main
form, it gives me an error message. Details:
I have 2 subforms called
"AutosGasData1sub" and "AutosGasData2sub". There is a field on each
subform called "Best MPG" that pulls the best MPG from queries called
"AutosGasStats1" and "AutosGasStats2" respectively. The subforms are
attached to a form called "AutomobileGasolineSearch".
I have added lookup fields to find the date of the Best MPG, and it
works when I open the subforms in form view. However, when I open
the
subforms on the Main form, I get an #Error.
This is the code:
=DLookUp("[Fill Date]","[AutosGasStats1]","[AVG MPG]='" & Forms!
AutosGasData1sub![Best MPG] & "'")
Thanks
I am trying to make a subform that opens on a main form. The code
works when I open the subform, but when the subform opens on the main
form, it gives me an error message. Details:
I have 2 subforms called
"AutosGasData1sub" and "AutosGasData2sub". There is a field on each
subform called "Best MPG" that pulls the best MPG from queries called
"AutosGasStats1" and "AutosGasStats2" respectively. The subforms are
attached to a form called "AutomobileGasolineSearch".
I have added lookup fields to find the date of the Best MPG, and it
works when I open the subforms in form view. However, when I open
the
subforms on the Main form, I get an #Error.
This is the code:
=DLookUp("[Fill Date]","[AutosGasStats1]","[AVG MPG]='" & Forms!
AutosGasData1sub![Best MPG] & "'")
Thanks