Append Text/Non-Text values to a field

AppendToTextList can only be used to append a text value to a field and AppendItemValue does not replace the item. Instead, it creates another item of the same name, and gives it the value you specify.

Especially when you want to append a date values ( variant ) to a multivalue date field, you cannot use the AppendToTextList since it covers the date value to a string and neither can you use the AppendItemValue because of the above limitation. The function below is used to append text/non-text values to a field.

Pass the document handle, the field name to which you want to append the value and the actual value that you want to append to the function.

Function AppendValues( doc As NotesDocument, fieldName As String, 
newValue As Variant ) As Integer ***************************************************************** ' Author : Kiran ' Purpose : This function is used to append text/non text values to the any given fieldName '**************************************************************** On Error Goto err_Handler If doc.HasItem( fieldName ) Then If doc.GetItemValue( fieldName ) ( 0 ) = "" Then Call doc.ReplaceItemValue( fieldName, newValue ) Else Call doc.ReplaceItemValue( fieldName, Arrayappend(
doc.GetItemValue( fieldName ), newValue ) ) End If AppendValues = True End If Exit Function err_Handler: AppendValues = False Resume ok_Exit ok_Exit: End Function

This was first published in June 2002

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.