I have found a sample database which hides or shows a subform on a form.
This may be helpful for you.
The sample is called 'ShowOrHideSubform'
From the website
www.databasedev.co.uk
It was there some months ago when I downloaded it - I am assuming the
sample
is still there.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
"Maarkr" <Maarkr@[EMAIL PROTECTED]
> wrote in message
news:3E0AB53D-2210-4533-A7B9-B848CF9D463E@[EMAIL PROTECTED]
> Well, you gave me an idea that I thought may work, but didn't. I tried
> using
> a different sub control name for just that form, but no go. I'll just
> have
> to think about it for awhile. Thanks
>
> "Jeanette Cunningham" wrote:
>
>> Hi Maarkr,
>> When a form loads, the subform loads before the main form loads.
>> I am not aware of any way to open a form by itself and then make it
>> become a
>> subform inside the subform control of an already open form.
>> You could try this method:
>> If you make the subform control invisible, it can be loading the
subform
>> invisibly.
>> To make both the subform control and the subform visible:
>> Me.Child45.Visible = true
>> Not sure that this will help with the speed of opening the main form.
>>
>> Jeanette Cunningham
>>
>> "Maarkr" <Maarkr@[EMAIL PROTECTED]
> wrote in message
>> news:D9B8939E-5D14-4777-AB57-DA7AF419FD47@[EMAIL PROTECTED]
>> >I have a main form, with a subform that is only visible when the
>> >appropriate
>> > cmdbtn is clicked, which loads the associated form. Works well:
>> >
>> > Private Sub CommandCSC_Click()
>> > Child45.SourceObject = "CSCfrm"
>> > Child45.Visible = True
>> > End Sub
>> >
>> > One of these forms uses the web activeX control, loading a web page.
>> > This
>> > works well, but it sometimes takes up to 15 seconds to load the web
>> > page.
>> > So
>> > I decided to load that form up as not visible when the main form is
>> > started,
>> > then make it visible when the associated cmdbtn is clicked, so it
comes
>> > up
>> > instantly.
>> > Problem is, I can make the form visible, but I can't figure how to
make
>> > it
>> > visible inside the subform. It becomes visible and now has the focus
>> > instead
>> > of the main form:
>> >
>> > Private Sub CommandWX_Click()
>> > If CurrentProject.AllForms("WXfrm").IsLoaded = True Then 'check
to
>> > see
>> > if it is loaded
>> > Forms!WXfrm.Visible = True 'this loads it as the
primary
>> > form
>> > Child45.SourceObject = "WXfrm" 'I thought this may make
>> > the
>> > form the subform but it doesn't
>> > End If
>> > Child45.Visible = True
>> > End Sub
>> >
>> > To recap... how to have the form become visible as the child45 source
>> > object.
>>
>>
>>


|