I am trying to learn how to use VB to change the properties of a Form. I have created an extremely simple database with no tables and just one form named “Form1”. I have created a module (Mod1) with the following code
Option Compare Database
Option Explicit
Dim Frm As Form
Sub test01()
Set Frm = Forms("Form1")
End Sub
Sub test02()
DoCmd.OpenForm ("Form1")
End Sub
When I run test01 I get a msg saying “Microsoft Access cannot find the referenced ‘Form1’ “
I know the form exists because it opens when I run test02
Can someone tell me how to set a variable of type Form to an existing form so I can start playing around with changing the form’s properties? I know one can manipulate controls once the form is loaded by using "Me.__"
but I would like to be able to manipulate form's properties from code outside the form's code file.
Thanks in advance