If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Run-time error '2147217900 (80040e14)
I have a tree list control I want to populate with Categories based on a
Client. The client number is input into a text box & then the update event populates the tree based on the selection. I get a syntax error when it tries to open the recordset based on the SQL. Two tables are invloved (Client & Categories; in a 1-to-many relationship on pID field). Here'e the code: Dim rstCategory As New ADODB.recordset, rstComponent As New ADODB.recordset Dim rstSubComponent As New ADODB.recordset Dim tvwTree As Object Dim nodX As Node Dim I As Integer Dim blnAllRecs As Boolean Dim SQL As String Set tvwTree = Me.tvwItems 'Renumber all items RenumberItems 'Clear out all current items tvwTree.Nodes.Clear 'Set blnAllRecs to use in query building If Me.fmeView = 1 Then blnAllRecs = False Else blnAllRecs = True End If 'Build recordset for Categories (from a pre-selected client) at top level SQL = "SELECT Categories.pID, Categories.catID, Categories.catName " & _ "FROM Categories " & _ "WHERE Categories.pID = " & Forms!frmComponents!txtpID & _ "ORDER BY Categories.catName" rstCategory.Open SQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly Any suggestions? -- Kro |
Thread Tools | |
Display Modes | |
|
|