Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

Visual Basic Sample Code to Access & Change a UDA Date Attribute

Visual Basic Sample Code to Access & Change a UDA Date Attribute

Problem:

Visual Basic Sample Code to Access & Change a UDA Date Attribute

Resolution:


  • Product Name: CaliberRM
  • Product Version: CaliberRM 2005 R2 SP1
  • Product Component: SDK
  • Platform/OS Version: Microsoft Platforms including XP / Windows 2000 / Windows Server 2003 / Windows Server 2005


Pre Requites:

  1. CaliberRM SDK installed
  2. Microsoft Word / Office installed
  3. Basic understanding of Object Orientated Programming and Visual Basic for Applications (VBA)
  4. KB Article 5624: CaliberRM: Visual Basic for Applications (VBA) , setting up a Microsoft Word VBA application. http://support.borland.com/entry.jspa?categoryID=435&externalID=5623

Description:

CaliberRM SDK: Visual Basic for Applications (VBA) , Sample Code to Access & Change a UDA Date Attribute


Answer/Solution:

Sample Code to Access & Change a UDA Date Attribute

Note: The UDA Date object is a OLEDate object and therefore a date can only be passed into the object.

"________________________________________________________

"Find all Date UDA Attributes and change them to today?s date

"________________________________________________________

Dim my_uda_date_value As UDADateValue

Dim my_date As Date

my_date = Date

no_of_attributes = my_requirement.AttributeValues.Count

For i = 0 To no_of_attributes - 1

"loop through list of attributes

Set my_attributes = my_requirement.AttributeValues.Item(i)

"check type of attribute

If my_attributes.Attribute.UITypeName = "Date" Then

Debug.Print my_attributes.Attribute.Name

"Cast attribute as UDADateVAlue

Set my_uda_date_value = my_attributes

"to change a UDA Date Value

my_requirement.lock

my_uda_date_value.OLEDate = my_date

my_requirement.Save ("SDK UDA Date Change")

my_requirement.unlock

End If

Next

"________________________________________________________


Author: David Carson

Old KB# 15870

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 18:26
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.