If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Exploratory question!
Is it possible to change the subform content depending on a different button clicked in the main form? -- How many buildings collapsed on 9/11? I can tell you the answer isn't 2 !! |
#2
|
|||
|
|||
Exploratory question!
Care to elaborate? Change the subform content how? Have a different
recordsource? Me!SubformControlName.Form.RecordSource = "SELECT Field1, Field2...." -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "scubadiver" wrote in message ... Is it possible to change the subform content depending on a different button clicked in the main form? -- How many buildings collapsed on 9/11? I can tell you the answer isn't 2 !! |
#3
|
|||
|
|||
Exploratory question!
Sure. You can change the recordsource of the subform, or the SourceObject.
You can also have two subforms, and just hide/display whichever one you like. -- Joan Wild Microsoft Access MVP scubadiver wrote: Is it possible to change the subform content depending on a different button clicked in the main form? -- How many buildings collapsed on 9/11? I can tell you the answer isn't 2 !! |
#4
|
|||
|
|||
Exploratory question!
"scubadiver" wrote in message
... Is it possible to change the subform content depending on a different button clicked in the main form? Yes. Keith. www.keithwilby.com |
#5
|
|||
|
|||
Exploratory question!
Sorry. When i meant "content" I meant the form itself.
I am thinking of a fancy main switch board menu. I have three buttons and I want each button to select a different form to put into the subform. Cheers! -- How many buildings collapsed on 9/11? I can tell you the answer isn''t 2 !! "Douglas J. Steele" wrote: Care to elaborate? Change the subform content how? Have a different recordsource? Me!SubformControlName.Form.RecordSource = "SELECT Field1, Field2...." -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "scubadiver" wrote in message ... Is it possible to change the subform content depending on a different button clicked in the main form? -- How many buildings collapsed on 9/11? I can tell you the answer isn't 2 !! |
#6
|
|||
|
|||
Exploratory question!
I want more than one subform and display one depending on which button I
click on the main form. Can you explain how. It might be useful :-) "Joan Wild" wrote: Sure. You can change the recordsource of the subform, or the SourceObject. You can also have two subforms, and just hide/display whichever one you like. -- Joan Wild Microsoft Access MVP scubadiver wrote: Is it possible to change the subform content depending on a different button clicked in the main form? -- How many buildings collapsed on 9/11? I can tell you the answer isn't 2 !! |
#7
|
|||
|
|||
Exploratory question!
Depending on the exact set up, you should be able to change the SourceObject
property of the subform control: If Me.MyCheckbox = True Then Me!SubformControlName.SourceObject = "sfrmChoice1" Else Me!SubformControlName.SourceObject = "sfrmChoice2" End If Don't forget that this might involve changing the LinkChildFields and LinkMasterFields properties as well. Or, as Joan suggested, you can simply have two separate subform controls, placed one on top of the other, and decide which one to make visible: If Me.MyCheckbox = True Then Me!SubformControlName1.Visible = True Me!SubformControlName2.Visible = False Else Me!SubformControlName1.Visible = False Me!SubformControlName2.Visible = True End If In the form's Open event, you might even put code like: Me!SubformControlName1.Top = Me!SubformControlName2.Top Me!SubformControlName1.Left = Me!SubformControlName2.Left to guarantee that they're exactly one on top of the other. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "scubadiver" wrote in message ... Sorry. When i meant "content" I meant the form itself. I am thinking of a fancy main switch board menu. I have three buttons and I want each button to select a different form to put into the subform. Cheers! -- How many buildings collapsed on 9/11? I can tell you the answer isn''t 2 !! "Douglas J. Steele" wrote: Care to elaborate? Change the subform content how? Have a different recordsource? Me!SubformControlName.Form.RecordSource = "SELECT Field1, Field2...." -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "scubadiver" wrote in message ... Is it possible to change the subform content depending on a different button clicked in the main form? -- How many buildings collapsed on 9/11? I can tell you the answer isn't 2 !! |
#8
|
|||
|
|||
Exploratory question!
Set the visible property of the subform controls to false. In your code you
would set the visible property of the subform control to true. Check out the samples in Help. -- Joan Wild Microsoft Access MVP scubadiver wrote: I want more than one subform and display one depending on which button I click on the main form. Can you explain how. It might be useful :-) "Joan Wild" wrote: Sure. You can change the recordsource of the subform, or the SourceObject. You can also have two subforms, and just hide/display whichever one you like. -- Joan Wild Microsoft Access MVP scubadiver wrote: Is it possible to change the subform content depending on a different button clicked in the main form? -- How many buildings collapsed on 9/11? I can tell you the answer isn't 2 !! |
#9
|
|||
|
|||
Exploratory question!
"scubadiver" wrote:
Is it possible to change the subform content depending on a different button clicked in the main form? Yet another way to do it is to create a Tab Control with three pages, one subform on each; and set the tab control's Style to Button rather than Tab. |
#10
|
|||
|
|||
Exploratory question!
Thanks Joan, I am working on it. "Joan Wild" wrote: Set the visible property of the subform controls to false. In your code you would set the visible property of the subform control to true. Check out the samples in Help. -- Joan Wild Microsoft Access MVP scubadiver wrote: I want more than one subform and display one depending on which button I click on the main form. Can you explain how. It might be useful :-) "Joan Wild" wrote: Sure. You can change the recordsource of the subform, or the SourceObject. You can also have two subforms, and just hide/display whichever one you like. -- Joan Wild Microsoft Access MVP scubadiver wrote: Is it possible to change the subform content depending on a different button clicked in the main form? -- How many buildings collapsed on 9/11? I can tell you the answer isn't 2 !! |
|
Thread Tools | |
Display Modes | |
|
|