I received help on determining the active page of a tab control, by having the following code included in a form module:
	
	
	
		
Now I want to do something similar, but instead of a tab control page, I'm looking to capture the name of the source object, for a subform control. I switch out the source object, and based on that, I need to change the header stuff - title caption, combo visible or not, combo rowsource, etc.
This is what I tried:
	
	
	
		
The .SourceObject is highlighted, when I attempt to compile, and I get an error that says "Wrong number of arguments or invalid property assignment".
Anyone know what I need to do, to get this to work? It will be helpful, in allowing me to write a simple select case, on that value, whenever I need in, during the operations on that form.
Thank you!
 
		Code:
	
	
	Property Get ActivePage() As Access.Page
    'PROPERTY TO IDENTIFY WHICH TAB WE ARE ON, FOR FILTERING AND IDENTIFYING WHICH ACTIVE LISTBOX TO LOOK AT, FOR VALUES AND ACTIONS
    With Me.tbAddFind
        Set ActivePage = .Pages(.Value)
    End With
End PropertyNow I want to do something similar, but instead of a tab control page, I'm looking to capture the name of the source object, for a subform control. I switch out the source object, and based on that, I need to change the header stuff - title caption, combo visible or not, combo rowsource, etc.
This is what I tried:
		Code:
	
	
	Property Get WhichSub() As Access.SubForm
    'PROPERTY TO IDENTIFY WHICH SUBFORM IS ACTIVE, FOR DETERMINING HEADER INFO AND BEHAVIOR
    With Me.SubEntryForm
        Set WhichSub = .SourceObject(.Name)
    End With
End PropertyThe .SourceObject is highlighted, when I attempt to compile, and I get an error that says "Wrong number of arguments or invalid property assignment".
Anyone know what I need to do, to get this to work? It will be helpful, in allowing me to write a simple select case, on that value, whenever I need in, during the operations on that form.
Thank you!
			
				Last edited: 
			
		
	
								
								
									
	
		
			
		
		
	
	
	
		
			
		
		
	
								
							
							 
	 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		