sanders720
Programmer
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("DESCRIPTION"
<> "" Then
Me.cboDescription.AddItem .Fields("DESCRIPTION"
End If
.MoveNext
Next q
.Close
.Open "SELECT DISTINCT SIZE 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("SIZE"
<> "" Then
Me.cboSize.AddItem .Fields("SIZE"
End If
.MoveNext
Next q
.Close
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("DESCRIPTION"
Me.cboDescription.AddItem .Fields("DESCRIPTION"
End If
.MoveNext
Next q
.Close
.Open "SELECT DISTINCT SIZE 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("SIZE"
Me.cboSize.AddItem .Fields("SIZE"
End If
.MoveNext
Next q
.Close