Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have several lines of code in a p 1

Status
Not open for further replies.

sanders720

Programmer
Aug 2, 2001
421
US
I have several lines of code in a program that look something like this. I recently added a field to my database called SIZE. All of the open statements (there were seven, now eight) worked. Now, the opening of the new object does not work.

I get an error as follows...

Run-time error '-2147467259(80004005)': Method "Open' of object '_Recordset' failed.

T don't understand this. I simply copied the code up, and changed 'DESCRIPTION' to 'SIZE'. I also added the field to my database as it is called. Why wouldn't the open work, if the criteria exists?

Thabks for the help...



The program

.CursorLocation = adUseClient

.Open "SELECT DISTINCT DESCRIPTION from tblStockList", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\deepblue\EngineeringBOM\Data\EngineeringBOM_data.mdb;Persist Security Info=False", adOpenStatic, adLockOptimistic
.MoveLast
c = .RecordCount
.MoveFirst
For q = 1 To c
If .Fields(&quot;DESCRIPTION&quot;) <> &quot;&quot; Then
Me.cboDescription.AddItem .Fields(&quot;DESCRIPTION&quot;)
End If
.MoveNext
Next q
.Close

.Open &quot;SELECT DISTINCT SIZE from tblStockList&quot;, &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\deepblue\EngineeringBOM\Data\EngineeringBOM_data.mdb;Persist Security Info=False&quot;, adOpenStatic, adLockOptimistic
.MoveLast
c = .RecordCount
.MoveFirst
For q = 1 To c
If .Fields(&quot;SIZE&quot;) <> &quot;&quot; Then
Me.cboSize.AddItem .Fields(&quot;SIZE&quot;)
End If
.MoveNext
Next q
.Close
 
Perhaps in Access, I think Size is a reserved keyword and you should refer to it as [Size] instead...

Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top