bobsan42
Well-known Member
- Joined
- Jul 14, 2010
- Messages
- 2,114
- Office Version
- 365
- 2019
- 2016
- 2013
- Platform
- Windows
Hello all.
My goal at the moment is: To open Form1 as background, make it translucent, then use the openArgs to pass a name to open Form2 on top of it. When Form2 is closed Form1 to close automatically.
I achieved it easily with DoCmd.OpenForm but then I have to set WindowMode:=acDialog, which shows the form titlebar and ruins the design.
So I am trying to make it in another way. After some time I got to the idea to declare (in the module of Form1) a form object withEvents, assign Form2 to it, open it and when it is closed it will close Form1.
So far the problem is:
Case 1: I get a Type mismatch error on the line Set frm = ....
Case 2: When I try this - The compiler just says Compile error: Object does not source automation events
It does not accept Variant or Object at all on this line.
Any workarounds, or better ideas than mine are welcome?
Thanks in advance.
My goal at the moment is: To open Form1 as background, make it translucent, then use the openArgs to pass a name to open Form2 on top of it. When Form2 is closed Form1 to close automatically.
I achieved it easily with DoCmd.OpenForm but then I have to set WindowMode:=acDialog, which shows the form titlebar and ruins the design.
So I am trying to make it in another way. After some time I got to the idea to declare (in the module of Form1) a form object withEvents, assign Form2 to it, open it and when it is closed it will close Form1.
So far the problem is:
Case 1: I get a Type mismatch error on the line Set frm = ....
VBA Code:
Private WithEvents frm As Access.Form
...
Set frm = CurrentProject.AllForms(Me.OpenArgs)
frm.Close = "[Event Procedure]"
DoCmd.OpenForm frm.Name
...
VBA Code:
Private WithEvents frm As AccessObject
Any workarounds, or better ideas than mine are welcome?
Thanks in advance.