CocodaMonkey
New member
- Local time
- Yesterday, 17:03
- Joined
- Oct 3, 2008
- Messages
- 4
I've been trying for awhile to set a subform as invisible from a button within the sub form itself. I have no problem doing it from the main form but can't figure out a way to do it from the sub form. I figured it's just an issue with the sub form not being allowed to have the focus when it's set to invisible but even if I set that it still doesn't work.
I have a main form called ClientsMainfrm. The subform is called ClientAddfrm. I can add "Me.ClientAddfrm.Visible = False" to any event on the main form and it works fine. But I need to be able to hide the sub form off an event inside the sub form itself so I figured I could do something like this in the sub form.
Forms![ClientsMainfrm].SetFocus
[ClientAddfrm].Form.Visible = false
For reasons I can't comprehend this actually closes the main form and makes it exit access completely. I've also tried things like
Forms![ClientsMainfrm].SetFocus
me.form.visible = false
and had no luck. Is it possible to hide a sub form based on an event from the sub form itself?
Thanks in advance for any help you can offer.
I have a main form called ClientsMainfrm. The subform is called ClientAddfrm. I can add "Me.ClientAddfrm.Visible = False" to any event on the main form and it works fine. But I need to be able to hide the sub form off an event inside the sub form itself so I figured I could do something like this in the sub form.
Forms![ClientsMainfrm].SetFocus
[ClientAddfrm].Form.Visible = false
For reasons I can't comprehend this actually closes the main form and makes it exit access completely. I've also tried things like
Forms![ClientsMainfrm].SetFocus
me.form.visible = false
and had no luck. Is it possible to hide a sub form based on an event from the sub form itself?
Thanks in advance for any help you can offer.