ACC97: Toggling Visible Property Makes Calendar Control Smaller

ID: Q164096


The information in this article applies to:


SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

When you toggle the Visible property of a Calendar control on a form from True to False and then back to True again, the control gets smaller on the form. It continues to shrink as you continue to toggle its Visible property.


CAUSE

The BorderStyle property of the Calendar control is set to something other than Transparent.


RESOLUTION

Set the BorderStyle property of the Calendar control to Transparent. Then if you want a border around the Calendar control, drag a Rectangle control around the Calendar control, and set the BorderStyle of the rectangle to the desired effect.


STATUS

Microsoft has confirmed this to be a problem in Microsoft Access 97.


MORE INFORMATION

Steps to Reproduce Problem


  1. Start Microsoft Access and open the sample database Northwind.mdb.


  2. Create the following new form not based on any table or query in Design view:
    
          Form: ShrinkCalendar
          -----------------------------
          Caption: Calendar Form
    
          Calendar control 8.0:
             Name: axCalendar
             BorderStyle: Solid
          Command button:
             Name: cmdToggle
             Caption: Toggle Calendar
             OnClick: [Event Procedure] 


  3. Type the following procedure in the OnClick property of the cmdToggle command button:
    
          Private Sub cmdToggle_Click()
             Me!axCalendar.Visible = Not Me!axCalendar.Visible
          End Sub 


  4. Save the ShrinkCalendar form and switch to Form view.


  5. Click the Toggle Calendar button repeatedly. Note that as the Calendar control disappears and reappears again, it becomes smaller. The effect is most noticeable if you click the command button 30 to 50 times.

    NOTE: If you close and reopen the form containing the Calendar control, the control expands to its original size.


Additional query words: ODE custom


Keywords          : kbdta 
Version           : 97
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: April 29, 1999