Skip to Content
0
Former Member
May 14, 2008 at 09:55 AM

ERROR

21 Views

This is the function for getting next numbers of U_ID Field..

 Public Function LoadControl()
        Try
            Dim objRs As SAPbobsCOM.Recordset = objCom.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
            Dim DataSource As SAPbouiCOM.DBDataSource = objFrm.DataSources.DBDataSources.Item("OPOR")
            objRs.DoQuery("select max(U_ID)+1 from [OPOR]")
            DataSource.SetValue("U_ID", DataSource.Offset, objRs.Fields.Item("U_ID").Value)
            System.Runtime.InteropServices.Marshal.ReleaseComObject(objRs)
            GC.WaitForPendingFinalizers()
            GC.Collect()
            objRs = Nothing
            Return True
        Catch ex As Exception
        End Try
    End Function

when i cross this line --- DataSource.SetValue("U_ID", DataSource.Offset, objRs.Fields.Item("U_ID").Value) -


it tells that INVALID FIELD NAME.... But the field is there... whats the problem....?