Share via


ListFieldLookup Object

ListFieldLookup
Multiple objects

Contains information about the Lookup field. The ListFieldLookup object allows you to search for information within the given Web site based on a specified field.

This object is supported only by Web pages or sites that are based on Microsoft SharePoint Services.

Using the ListFieldLookup object

Use ListFields .Item(index), where index is the name or ordinal position of a field of type fpFieldLookup, to return a single ListFieldLookup object.

Use the ListFields.Add method to add a field of type ListFieldLookup to the ListFields collection.

The following example adds a new field named NewFileLookupField of type fpFieldLookup to the ListFields collection.

Sub CreateLookup()
'Add new Lookup field

    Dim objApp As FrontPage.Application
    Dim objLstFlds As ListFields
    Dim objFldLookup As ListFieldLookup
    Dim strName As String

    Set objApp = FrontPage.Application
    Set objLstFlds = objApp.ActiveWeb.Lists.Item(0).Fields
    strName = "NewFileLookupField"
    'Add new Field of type fpFieldLookup to list
    objLstFlds.Add Name:=strName, Description:="New Lookup Field", _
                   Fieldtype:=fpFieldLookup
    Set objFldLookup = objLstFlds.Item("NewFileLookupField")
    MsgBox "A new field named " & strName & " was added to the list " & _
           objApp.ActiveWeb.Lists.Item(0).Name & "."

End Sub

Properties | Application Property | Description Property | LookupField Property | Name Property | Parent Property | ReadOnly Property | Type Property | Web Property

Methods | ConvertToField Method | Delete Method | Move Method

Parent Objects

Child Objects | ListField Object | Web Object