andrewmrichards
Registered User.
- Local time
- Today, 15:55
- Joined
- Mar 15, 2012
- Messages
- 18
Hi all,
I hope you can help with this - it's been driving me up the wall today, but I've never come across it as a problem before.
I have forms set up as follows:
frmFrame - this holds a Subform control called ChildForm.
ChildForm has as its SourceObject a form called frmTitleOuter
frmTitleOuter has a number of OptionButton controls, and also a Subform control, once again called ChildForm.
The ChildForm control of frmTitleOuter can contain various forms to show different kinds of information.
I've attached a screenshot of this, to hopefully help you to visualise it.
Depending on which form is showing in the frmTitleOuter's ChildForm control, some of the OptionButtons should be made visible and others hidden.
So, here's my problem.
I have code on frmTitleOuter which looks like this:
This has always worked. But now, the SourceObject property is returning an empty string.
However, if I re-write the code to say
then I get returned the name of the child form as expected.
I'm having the same issue with another bit of code, which should switch the subform...
is now refusing to work, but
works fine.
Might it make a difference that the code is originally being called from the subform of frmTitleOuter? The code itself resides in frmTitleOuter, but can be called from various events.
It's worked absolutely fine for years, but I'm having to re-develop bits as part of a migration to SQL Server, and I've not actually changed any of this code, which is why I'm confused as to why it's popped up as an issue now! If you can help, I'll be eternally grateful.
Many thanks
Andrew
I hope you can help with this - it's been driving me up the wall today, but I've never come across it as a problem before.
I have forms set up as follows:
frmFrame - this holds a Subform control called ChildForm.
ChildForm has as its SourceObject a form called frmTitleOuter
frmTitleOuter has a number of OptionButton controls, and also a Subform control, once again called ChildForm.
The ChildForm control of frmTitleOuter can contain various forms to show different kinds of information.
I've attached a screenshot of this, to hopefully help you to visualise it.
Depending on which form is showing in the frmTitleOuter's ChildForm control, some of the OptionButtons should be made visible and others hidden.
So, here's my problem.
I have code on frmTitleOuter which looks like this:
Code:
If Me.ChildForm.SourceObject = "fsubFormatTracks" Then
' hides some and shows other buttons
However, if I re-write the code to say
Code:
If Forms("frmFrame").ChildForm.Form.ChildForm.SourceObject="fsubFormatTracks" Then
' etc
I'm having the same issue with another bit of code, which should switch the subform...
Code:
Me.ChildForm.SourceObject="fsubTitleFormats"
Code:
Forms("frmFrame").ChildForm.Form.ChildForm.SourceObject="fsubTitleFormats"
Might it make a difference that the code is originally being called from the subform of frmTitleOuter? The code itself resides in frmTitleOuter, but can be called from various events.
It's worked absolutely fine for years, but I'm having to re-develop bits as part of a migration to SQL Server, and I've not actually changed any of this code, which is why I'm confused as to why it's popped up as an issue now! If you can help, I'll be eternally grateful.
Many thanks
Andrew