You can try thus one.
Dim oUserTable As SAPbobsCOM.UserTable
oUserTable = oCompany.UserTables.Item("APP_AMS1")
With oUserTable
If .GetByKey(1) Then
txtCode.Value = .Code
Else
oSAP.SetMessage("No matching record found. (Code)[APP_AMS1]", SAPbouiCOM.BoStatusBarMessageType.smt_Error)
Return False
End If
End With








.jpg)


