Examples: Item property


The following procedure runs when the user clicks a button in a VBA user form. It loops through a properties collection and uses the Item property to check the property named Item Weight:

Private Sub UpdateItemLocation_Click()
	Dim ItemCollection As DUOSObjects
	Dim ItemObject As DUOSObject
	Dim ItemProperties As DUOSProperties
	Dim ItemProperty As DUOSProperty

	Set ItemCollection = DUOSObjectsGet("ItemCollection")

	For Each ItemObject In ItemCollection
		For Each ItemProperty In ItemProperties
			If ItemProperties.Item("Item Weight") > "100.00" Then
				'The item is greater than 100 pounds
				ItemProperties.Item("Storage Location") = _
				"Bulk Item Area"
			End If
		Next
	Next
End Sub

In this example, the Item property references the position of the property rather than the name:

Private Sub CommandButton_Click()
	Dim ItemCollection As DUOSObjects
	Dim ItemObject As DUOSObject
	Dim ItemProperties As DUOSProperties

	'Specify the collection
	Set ItemCollection = DUOSObjectsGet("Additional Item Info")
	'Specify an object in the collection with a unique object ID
	Set ItemObject = ItemCollection.Item("ITM002")
	'Get properties for the object
	ItemObject.Properties(3) = "3.5"
End Sub


Documentation Feedback