Dim RetVal As Long Dim vBP As SAPbobsCOM.BusinessPartners Set vBP = vCmp.GetBusinessObject(oBusinessPartners) 'Retrieve a record by its key from the database RetVal = vBP.GetByKey("BP00234") 'Check errors If RetVal <> 0 Then vCmp.GetLastError ErrCode, ErrMsg MsgBox "Failed to Retrieve the record " & ErrCode & " " & ErrMsg Exit Sub End If