-----Original Message-----
Hi Chris,
This is the code I am trying to run.
The first error, it hits the .RemoveItem throwing "Method or Data member not
found.
The second one, it hits the .AddItem and throws the same error.
Finally it throws error on rs.open line
error lines are highlighted in RED
This is the code;
Private Sub cboPartNo_BeforeUpdate(Cancel As Integer)
Dim rs As adodb.Recordset
Dim sqlstr As String
Dim quote As String
Dim nCount As Long
quote = """"
Set cnn = CurrentProject.Connection
Set rs = New adodb.Recordset
'cboPartNo, cboProdGrp, cboTherapy, cboProjMgr are comboboxes
sqlstr = "select OraclePartInventory.[Item Description]," + _
"OProdGroup.Description, OProdGroup.ProjMgr_ID," + _
"OProdGroup.TherapyLine_ID FROM OProdGroup, OraclePartInventory"
sqlstr = sqlstr + " where OProdGroup.ProdGroupID_TX =
OraclePartInventory.ProdGroupID_TX"
sqlstr = sqlstr + " and OraclePartInventory.[item Number] ="
sqlstr = sqlstr + quote + cboPartNo.Value + quote
rs.Open sqlstr, cnn, adOpenKeyset, adLockPessimistic, adCmdText
' MsgBox rs.RecordCount
nCount = 0
If cboProdGrp.ListCount > 0 Then
Do While cboProdGrp.ListCount > 0
cboProdGrp.RemoveItem (nCount)
nCount = nCount + 1
Loop
End If
nCount = 0
If cboTherapy.ListCount > 0 Then
Do While cboTherapy.ListCount > 0
cboTherapy.RemoveItem (nCount)
nCount = nCount + 1
Loop
End If
nCount = 0
If cboProjMgr.ListCount > 0 Then
Do While cboProjMgr.ListCount > 0
cboProjMgr.RemoveItem (nCount)
nCount = nCount + 1
Loop
End If
If rs.RecordCount > 0 Then
PartDesc.Value = rs.Fields(0).Value
cboProdGrp.AddItem rs.Fields(1).Value, 0
cboTherapy.AddItem rs.Fields(3).Value, 0
cboProjMgr.AddItem rs.Fields(2).Value, 0
End If
rs.Close
End Sub
Thank you and have a Good day!
Rajesh Candamourty
Thomas said:
I am using MS Access 2000 (9.0.6926 SP-3) with MS OS Windows 2000 at work.
The AddItem method is missing? At home I have MS XP OS and running Access
2000 and AddItem method is available and runs fine. I
transport it to
work
and get a run time error. Is there a missing .dll or library with MS
Windows 2000?
Thank you for your kind cooperation.
Thomas Vincent
.