Examples: Item property

The following procedure runs when the user clicks a button in a VBA user form. It returns a collection named Item Info, then uses the Item property to return a data object with an objectID matching the Item Number in the Item Maintenance window. The Set statement assigns the returned data object to an object variable named ItemObject. The Remove method then deletes the object returned by the Item property:

Private Sub DeleteItem_Click()
	Dim ItemCollection As DUOSObjects
	Dim ItemObject As DUOSObject

	Set ItemCollection = DUOSObjectsGet("ItemInfo")
	'Specify a data object using a window field value
	Set ItemObject = ItemCollection.Item(ItemMaintenance.ItemNumber)
End Sub

Documentation Feedback