ACC2000: Pages Option Button Is Not Available in CommonDialog Control (207689)
The information in this article applies to:
This article was previously published under Q207689 Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
SYMPTOMS
The Pages option button of the CommonDialog ActiveX control is unavailable when the Flags property is set to cdlPDPageNums.
CAUSE
This behavior occurs because the default value for Min and Max of the CommonDialog control is 0 when the Flags property is set to cdlPDPageNums. Therefore, you cannot enter a valid page rage in the From and To boxes.
RESOLUTIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
To resolve this behavior, the Max property of the CommonDialog control needs to be set to a value
greater than 0, and greater than the value of the control's Min property.
To enable the Pages option button, follow these steps:
- Follow steps 1 through 6 of the "Steps to Reproduce Behavior" section later in this article.
- Set the On Click property for the command button to the following event procedure:
Private Sub Command1_Click()
Dim cd As CommonDialog
Set cd = Me!CmnDlg.Object
With cd
.Flags = cdlPDPageNums
' Allow a page range of 1 - 50 to be entered in
' the dialog box.
.Min = 1
.Max = 50
' Default the From box to 1, and the To box to 50.
' Note that the FromPage property must be greater than or
' equal to the Min property, and the ToPage property
' must be less than or equal to the Max property.
.FromPage = 1
.ToPage = 50
.ShowPrinter
End With
End Sub
- On the View menu, click Form View.
- Click the command button.
Note that the Pages option button and associated edit controls are enabled, and the page range is set from 1 to 50 by default.
Modification Type: | Major | Last Reviewed: | 6/23/2005 |
---|
Keywords: | kbprb KB207689 |
---|
|