Switch between subforms using a button

S

Sietske

Dear all,

I've got one main form and two subforms.
I'd like to switch between subforms using a button (instead of tabs, I
have my reasons for that).

Main form: frmMain
Subforms: frmSub1 and frmSub2
Location of subform label on main form: lblLocationSubform
Location of subform on main form: formLocationSubform

So far, I only succeeded in letting the button change the label, by
using

lblLocationSubform.Caption = "This title appears above the
subform"

What additional code do I need for letting the button change the
subform itself too?
The solution is probably very easy, but I just don't know in what
direction I should be looking.
I was thinking of using something like

formLocationSubform.Form.Something = Forms!frmSub1

Could one of you please help me out?
 
S

Sietske

Solved it in the meantime by using

Me.formLocationSubform.SourceObject = "frmSub1"

But thanks anyway! :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top