I have a few ideas. First, the code you found works for Excel, not Access.
Second is an interesting semantics issue around the word "missing". No reference shows missing because none of the selected references are missing. They are present on your system. Access isn't smart enough, nor could it be, to look at your code
and say: that WOULD compile if only you had a reference to X, so X is missing.
And don't add a reference to Excel. That won't solve the problem because Access' Application object does not have a WindowsState property, and never will, regardless of which references you select.
Third, here is a solution using Windows API calls. Forms have a window handle property .Hwnd
https://stackoverflow.com/questions/28266448/get-the-last-showwindow-state-for-a-window-in-winapi
Yes, the link is for another programming language, but it's close enough you can start to figure it out.
-Tom. Microsoft Access MVP