UseDefaultPrinter Property

Microsoft Access Visual Basic

Show All

UseDefaultPrinter Property

       

Returns or sets a Boolean indicating whether the specified form or report uses the default printer for the system; True if the form or report uses the default printer. Read/write.

expression.UseDefaultPrinter

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

Remarks

This property is read/write in Design view and read-only in all other views.

When this property is True, the form or report inherits all of its printer settings from the settings of the default printer. Changing the printer associated with a form or report by assigning its Printer property to a Printer object sets the UseDefaultPrinter property to False.

Example

The following example checks to see if the specified form is using the default printer; if not, the user is asked if it should.

Function CheckPrinter(frmTemp As Form) As Boolean

    If frmTemp.UseDefaultPrinter = False Then
        If MsgBox("Should this form use " _
                & "the default printer?", _
                vbYesNo) = vbYes Then
            frmTemp.UseDefaultPrinter = True
        End If
    End If

End Function