I have the following code:
Dim sqlstring As String
sqlstring = "select * from GuidelineCategories order by GuidelineCategoryID"
Dim db As Variant
Dim rst As Recordset
Set db = CurrentDb
Set rst = db.openrecordset(sqlstring)
rst.MoveFirst
While Not rst.EOF
If rst.Fields("ParentID" = 0 Then
CategoryTree.Nodes.Add , , rst.Fields("GuidelineCategoryID", rst.Fields("Category"
Else
CategoryTree.Nodes.Add rst.Fields("ParentID", tvwChild, rst.Fields("GuidelineCategoryID", rst.Fields("Category"
End If
rst.MoveNext
Wend
But I get an Err 13 Type mismatch in the following line:
Set rst = db.openrecordset(sqlstring)
I tripple checked the column and table names, they are correct. Any idea why this is not working?
Dim sqlstring As String
sqlstring = "select * from GuidelineCategories order by GuidelineCategoryID"
Dim db As Variant
Dim rst As Recordset
Set db = CurrentDb
Set rst = db.openrecordset(sqlstring)
rst.MoveFirst
While Not rst.EOF
If rst.Fields("ParentID" = 0 Then
CategoryTree.Nodes.Add , , rst.Fields("GuidelineCategoryID", rst.Fields("Category"
Else
CategoryTree.Nodes.Add rst.Fields("ParentID", tvwChild, rst.Fields("GuidelineCategoryID", rst.Fields("Category"
End If
rst.MoveNext
Wend
But I get an Err 13 Type mismatch in the following line:
Set rst = db.openrecordset(sqlstring)
I tripple checked the column and table names, they are correct. Any idea why this is not working?