Solved Unbound subform opens based upon button click

donkey9972

Registered User.
Local time
Today, 13:01
Joined
May 18, 2008
Messages
82
Okay, since my other issue with using tabs was essentially unsolvable due to lack of information available, well at least a lack of information I could find using a search engine. I have a new idea but I am not sure how to accomplish it, not to mention I was researching my other issue and I saw some information that was concerning, basically if you bind several sub-forms to a main form using tabs that it slows your form loads down a huge amount over time. So to avoid that I am hoping I can try to get something else figured out. So here goes...

I want to have a main form, with buttons on the left side.

Btn1
Btn2
Btn3
etc...

Then to the right of that have an unbound sub-form. Then when one of the buttons are pressed it will load the corresponding form into the sub-form. I know how to press a button and make a new form appear (macro and VBA). I am just not sure how to do the same in order to put it into the unbound sub-form. I need help, but lets leave the therapist out of this for now.
 
Okay so here is where I am at. I have a code now that I can use and it works great for the first sub-form load.

The code is
Code:
Private Sub Btn1_Click()
    Me!Child12.SourceObject = "Page1"
End Sub

Private Sub Btn2_Click()
    Me!Child12.SourceObject = "Page2"
End Sub

Private Sub Btn3_Click()
    Me!Child12.SourceObject = "Page3"
End Sub

However, with the use of any other buttons this does not work. It just loads Page 1 for all of them. What do I need to adjust in order for it to load the other pages when I click the button associated with those pages?
 
Nevermind, I figured out where the problem was, it was operator error. Just so I could identify which page was loading before I started actually setting things up how I wanted for each form, I simply put a text box on each form. I copy and pasted between all 3 forms, and I simply forgot to change the text in each form. They all said the same thing. *Slaps forehead*.
 
Dont you think it would make more sense to show the code that doesn't work rather than than the code that does?

The code you have shown looks valid to me
 
The code does work. I was just stating I figured out my issue so no one else had to help with this problem was all.
 

Users who are viewing this thread

Back
Top Bottom