ted.martin
Registered User.
- Local time
- Today, 17:41
- Joined
- Sep 24, 2004
- Messages
- 743
I have a form that I use both as a continuous Form and a continuous SubForm. There is a Close button on this form except that I hide this button when the form is being loaded as a Sub-Form.
The way I do this is to use the cmdClose.Visible code is put in the Load event of the form a check to see if the Parent Form is Loaded.
However this code is becoming cumbersome as the form could be loaded in 3 or 4 separate instances as a SubForm.
I was wondering whether there was a simple way to check whether a form was being loaded as a subform or not.
I have thought about using some code based around Me.Parent.Name but that gives me a 2427 error. I can work with this but again wonder if there is a more elegant way?
Many thanks
The way I do this is to use the cmdClose.Visible code is put in the Load event of the form a check to see if the Parent Form is Loaded.
However this code is becoming cumbersome as the form could be loaded in 3 or 4 separate instances as a SubForm.
I was wondering whether there was a simple way to check whether a form was being loaded as a subform or not.
I have thought about using some code based around Me.Parent.Name but that gives me a 2427 error. I can work with this but again wonder if there is a more elegant way?
Many thanks