A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Run-time error '2147217900 (80040e14)



 
 
Thread Tools Display Modes
  #1  
Old March 16th, 2008, 08:43 PM posted to microsoft.public.access
Kro
external usenet poster
 
Posts: 8
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:43 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.