A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Switch between subforms using a button



 
 
Thread Tools Display Modes
  #1  
Old April 17th, 2008, 10:53 AM posted to microsoft.public.access.forms
Sietske[_2_]
external usenet poster
 
Posts: 2
Default Switch between subforms using a button

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?



  #2  
Old April 17th, 2008, 12:28 PM posted to microsoft.public.access.forms
Sietske[_2_]
external usenet poster
 
Posts: 2
Default Switch between subforms using a button

Solved it in the meantime by using

Me.formLocationSubform.SourceObject = "frmSub1"

But thanks anyway! :-)
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:26 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.