MinimumValue Property

Microsoft FrontPage Visual Basic

property to set the maximum allowed value of the field.

Example

The following example displays the names and minimum values for all fields of type fpFieldNumber and fpFieldCurrency in the first list of the active Web site.

Sub DisplayMinimum()
'Displays the minimum value of all ListFieldNumber
'and ListFieldCurrency fields in the list

    Dim objApp As FrontPage.Application
    Dim objLstFlds As ListFields
    Dim strName As String
    Dim objLstFld As Object
    Dim strValues As String

    Set objApp = FrontPage.Application
    Set objLstFlds = objApp.ActiveWeb.Lists.Item(0).Fields
    'Cycle through lists and add value to string
    For Each objLstFld In objLstFlds
        If (objLstFld.Type = fpFieldNumber) Or (objLstFld.Type = fpFieldCurrency) Then
            strValues = strValues & objLstFld.Name & vbTab & _
                        objLstFld.MinimumValue & vbCr
        End If
    Next objLstFld

    If strValues <> "" Then
        MsgBox "The fields and their minimum values are:" & vbCr & _
                vbCr & strValues
    Else
        MsgBox "There are no ListFieldNumber or ListFieldCurrency fields in the current list."
    End If

End Sub

The following example changes the minimum value of all fields of type fpListFieldNumber in the first list in the active Web site to a constant with the value 200.

Note  Use the ApplyChanges method to apply any changes made to the list.

Sub ChangeMinimum()
'Changes minimum value for all fields of type
'ListFieldNumber

    Dim objApp As FrontPage.Application
    Dim objLstFlds As ListFields
    Dim strName As String
    Dim objLstFld As Object
    Const varMin As Variant = 1

    Set objApp = FrontPage.Application
    If objApp.ActiveWeb.Lists.Count > 0 Then
        Set objLstFlds = objApp.ActiveWeb.Lists.Item(0).Fields
        'Cycle through lists and change values
        For Each objLstFld In objLstFlds
            If objLstFld.Type = fpFieldNumber Then
                objLstFld.MinimumValue = varMin
            End If
        Next objLstFld
        objApp.ActiveWeb.Lists(0).ApplyChanges
    Else
        MsgBox "The active Web site contains no lists."
    End If
End Sub