ClaraBarton
Registered User.
- Local time
- Today, 05:58
- Joined
- Oct 14, 2019
- Messages
- 754
I have a main form with a subform. 
	
	
	
		
When the current event runs on the subform, I want a control on the parent form to become active but It can't seem to find it.
Since this code is on the parent form, how should the following code be addressed:
	
	
	
		
I've tried Me.Parent...
and Form.MainForm...
neither works
 
		Code:
	
	
	Private WithEvents subFrm As Access.Form
Private Sub Form_Open(Cancel As Integer)
   ' set withevents variable to the subform object
   Set subFrm = Me.fsubDetail.Form
   ' ensure subform object raises Current event
   subFrm.OnCurrent = "[Event Procedure]"
End SubSince this code is on the parent form, how should the following code be addressed:
		Code:
	
	
	Private Sub subFrm_Current()
 On Error GoTo errlbl
 Dim strKey As String
   strKey = "IT" & Me.ItemID
       TVW.TreeView.Nodes(strKey).Selected = True  'Element not found
       TVW.TreeView.SelectedItem.EnsureVisible
       TVW.TreeView.DropHighlight = Me.TVW.SelectedNode
  Exit Suband Form.MainForm...
neither works
 
	 
 
		 
 
		 
 
		