Share via


MinimumValue Property

Returns or sets a Variant that specifies the minimum allowed value for the field. This property is the equivalent of setting the Minimum value allowed field in the Modify Field dialog box of the user interface. Read/write.

expression.MinimumValue

*expression   * Required. An expression that returns one of the objects in the Applies To list.

Remarks

An error message will be displayed to the user if invalid information is entered into this field. Use the MaximumValue 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

Applies to | ListFieldCurrency Object | ListFieldNumber Object

See Also | MaximumValue Property