As a further update... When I thought more on this, I realized that this is
not an active x error exactly. And then it dawned on me that I've seen this
one before. It was right after installing office 2000, apparently there was
a newer version of the cmctrl32.ocx, so instead of the reference showing as
"MS Windows Common Controls 5.0 SP2", it was MS Windows Common Controls 6.
And for whatever reason, 6 put up the error 438, whereas the previous common
controls did not. So I had switched back to common controls 5 and forgot all
about it.
And this all makes sense now, because when I isntall cmctrl32.ocx, I have
the file set to version (so it won't replace if the version is newer), and
of course, the user must have a newer cmctrl32, which is the common controls
6.
I'll include my tree code, as there's something that 6 doesn't like that
common controls 5 had no trouble with:
Public Function SetupTreeView(SetupType As String)
On Error GoTo ErrRtn
'Add Node objects.
Dim f As Form, firstnode As String, nodX As Node, NodX2 As Node, NodX3 As
Node, NodX4 As Node, db As Database, rs As Recordset, rs2 As Recordset,
criteria As String, rs3 As Recordset, rs4 As Recordset, criteria2 As String,
criteria3 As String
' Declare Node variable.
' First node with 'Root' as text.
Set f = Forms!fParts.Form
f!PartCatsTreeView.Nodes.Clear
f!PartCatsTreeView.Nodes.Clear
goSub SetupTree
exitout:
'
Exit Function
'
SetupTree:
Set db = CurrentDb()
Set rs = db.OpenRecordset("qrycboFilter", DB_OPEN_SNAPSHOT)
Set rs2 = db.OpenRecordset("qrycboFilterSub", DB_OPEN_SNAPSHOT)
Set rs3 = db.OpenRecordset("qrycboFilterSub", DB_OPEN_SNAPSHOT)
Set rs4 = db.OpenRecordset("qrycboFilterSub", DB_OPEN_SNAPSHOT)
If Not rs.BOF Then
rs.MoveFirst
firstnode = rs!CatDescription
Do Until rs.EOF
'Tree Level 1, Root
Set nodX = f!PartCatsTreeView.Nodes.Add(, , Chr(34) &
rs!PartCategoryID & Chr(34), rs!CatDescription)
' This next node is a child of Node 1 ("Root").
criteria = "CategoryOfID = " & rs!PartCategoryID
rs2.FindFirst criteria
Do Until rs2.NoMatch
'Tree Level 2
Set NodX2 = f!PartCatsTreeView.Nodes.Add(nodX, tvwChild, Chr(34)
& rs2!PartCategoryID & Chr(34), rs2!CatDescription)
criteria2 = "CategoryOfID = " & rs2!PartCategoryID
rs3.FindFirst criteria2
Do Until rs3.NoMatch
'Tree Level 3
Set NodX3 = f!PartCatsTreeView.Nodes.Add(NodX2, tvwChild,
Chr(34) & rs3!PartCategoryID & Chr(34), rs3!CatDescription)
criteria3 = "CategoryOfID = " & rs3!PartCategoryID
rs4.FindFirst criteria3
Do Until rs4.NoMatch
'Tree Level 4
Set NodX4 = f!PartCatsTreeView.Nodes.Add(NodX3,
tvwChild, Chr(34) & rs4!PartCategoryID & Chr(34), rs4!CatDescription)
rs4.FindNext criteria3
Loop
rs3.FindNext criteria2
Loop
rs2.FindNext criteria
Loop
rs.MoveNext
Loop
End If
rs.Close
rs2.Close
rs3.Close
rs4.Close
db.Close
Return
'cboFilter_NodeClick (Me!cboFilter.Nodes(firstnode))
'Set Me!cboFilter.SelectedItem = Me!cboFilter.ListItems(1)
ErrRtn:
If Err = 94 Or Err = 13 Then
MsgBox "SetupTreeView: You are missing the part type descriptions for
one or more part types. Click on the Setup button, then Part Categories tab
and fill in any missing part type descriptions.", vbCritical, "Missing Part
Category Descriptions"
Exit Function
Else
MsgBox Err.Number & " - " & Err.Description & ", Function:
SetupTreeView", vbCritical
End If
Exit Function