Microsoft KB Archive/207689

= ACC2000: Pages Option Button Is Not Available in CommonDialog Control =

Article ID: 207689

Article Last Modified on 6/23/2005

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



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.



RESOLUTION
Microsoft 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.



Steps to Reproduce Behavior
 Start Microsoft Access and open any database.</li> Create a new, blank form in Design view, not based on any table or query.</li> On the Insert menu, click ActiveX Control.</li> Select Microsoft Common Dialog Control, version 6.0, and then click OK.</li> Set the Name property of the CommonDialog control to CmnDlg .</li> Add a command button to the form.</li>  Set the command button's On Click property to the following event procedure: Private Sub Command1_Click Dim cd As CommonDialog Set cd = Me!CmnDlg.Object ' Enable Pages option button. cd.Flags = cdlPDPageNums cd.ShowPrinter End Sub </li> On the View menu, click Form View.</li> Click the command button.</li></ol>

Note that the Pages option button and associated edit controls are unavailable, even though the Flags property is set to the cdlPDPageNums constant.

Additional query words: prb custom disabled

Keywords: kbprb KB207689

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.