ClaraBarton
Registered User.
- Local time
- Today, 15:05
- Joined
- Oct 14, 2019
- Messages
- 524
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 Sub
Since 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 Sub
and Form.MainForm...
neither works