Got a question on VBA Invalid use of property error

B

Brent E

Good morning,

I am curious what I need to do correct an error I am getting? This is a
section of my code:
DoCmd.OpenForm "CURRYEAR", acNormal, , , , acDialog
Forms!CURRYEAR.Visible False
But I get a "Invalid use of property" error on Forms!CURRYEAR.Visible False
line. What must I do to hide the form upon open? Or maybe there is a better
way to get this. I am trying to set a variable equal to a textbox entered by
a user on a form, but as far as I can tell, seems my form must be open in
order to get the value from the form. I need to know a way to correct this
error, or another way to do this, or can I pull this value directly from
related table w/out needing to open the table first. Thanks
 
Top