1 of 1 people found this helpful
Here's how you could do it with tags. It should be easy for you to modify it to work with Element from AF.
Private Sub TextBox1_Change()
On Error Resume Next
'remove existing tags
If Trend1.TraceCount > 0 Then
For i = Trend1.TraceCount To 1 Step -1
2 of 2 people found this helpful
Do the users know the name of all 200,000 elements well enough to be able to type them? It may be better to build a mock hierarchy using weak references that breaks down the 200,000 elements so it's easier to find what they're after by adding the root of this new structure to Element relative display sidebar. I haven't tried using the Processbook swicth element tool with 200,000 elements however!
That said, assuming all elements had the same parent element, the following would work is they just type the element name into a textbox, assuming it had been set to an initial element page (it's replacing the last node in the current element path, if they knew the full path, you could remove lines 5-7 and have line 2 set newContextpath instead.
Private Sub CommandButton1_Click() myElement = TextBox1.Text Dim AFContext As ContextHandler Set AFContext = Application.ContextHandlers("E") oldElement = AFContext.CurrentContext(ThisDisplay) rootElement = Left(oldElement, InStrRev(oldElement, "\")) newContextPath = rootElement & myElement AFContext.CurrentContext(ThisDisplay) = newContextPath End Sub
Thank you both, Al and Keilan. Both solutions worked great. Thank you very much. I did have to change Al's response a bit (added a command button) only because each time you touch the keyboard, the change routine is called.
The reason I did it that way was because the original request made no mention of a button, just typing in the textbox.
Glad you were able to make it work though.