Change a sub form SourceObject from a current sub form.

M

Matt

So what I want to do is to have one sub form to act as a menu.
So when a user clicks a button on the menu, changes the menu changes to the
selected menu.
How can I reference the sub form from its self? I am trying to use the
SourceObject to do this.
 
S

Stefan Hoffmann

hi Matt,
So what I want to do is to have one sub form to act as a menu.
So when a user clicks a button on the menu, changes the menu changes to the
selected menu.
How can I reference the sub form from its self? I am trying to use the
SourceObject to do this.
I don't understand you problem. You may use Me.


mfG
--> stefan <--
 
M

Matt

I have one main form that has a sub form on it which is the menu.
So when a button is clicked on the sub-form I then want the contents of that
sub-form to change so that the first menu is unloaded and the next menu is
loaded in its places.
My understanding of how to do this is as follows: when the button is clicked
on the sub-form main menu, the sub-form changes its contents to the next
sub-menu. I was trying to use the following code:
froms.frmMainMenu.SubMenu.SourceObject = frmSubMenu2 but it kept coming up
object required.
 
S

Stefan Hoffmann

hi Matt,

Matt write:
I was trying to use the following code:
froms.frmMainMenu.SubMenu.SourceObject = frmSubMenu2 but it kept coming up
object required.
Ah, even if it is named SourceObject it only takes the Name of the
object as value:

.frmMainMenu.SubMenu.SourceObject = "frmSubMenu2"

mfG
--> stefan <--
 
M

Matt

Hi
thanks for your help i got it working use this code
Forms![frmMainMenu]![temp].SourceObject = "frmMenuSubPlacementManagement"
Thanks again
 
Top