ACC: Dropdown Method of Combo Box Not Working in Load Event of Form (181078)
The information in this article applies to:
- Microsoft Access for Windows 95 7.0
- Microsoft Access 97
This article was previously published under Q181078 Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
When you use the Dropdown method of a combo box in the Load event of a
form, the combo box list does not automatically drop down when the form
opens.
CAUSE
The form contains a subform that is displayed in Datasheet view.
RESOLUTION
Use one of the following methods to work around this problem.
Method 1
Invoke the Dropdown method of the combo box in the Open event instead of in
the Load event.
Method 2- Create a subform whose DefaultView property is set to Continuous Forms
and whose ViewsAllowed property is set to Both.
- In Design view of the main form that contains the combo box, set the
SourceObject property of the subform control to the form that you
created in step 1.
- Create another form, which will serve as the subform that you want to
display on the main form. Set its DefaultView and ViewsAllowed
properties to Datasheet.
- Set the OnLoad property of the form to the following event procedure:
Private Sub Form_Load()
Me![ctlDropCombo].SetFocus
Me![ctlDropCombo].Dropdown
Me![ContinuousSub].SourceObject = "DatasheetSub"
End Sub
This event procedure assumes that the name of your combo box is
ctlDropCombo, the name of your subform control is ContinuousSub, and the
name of the subform that you created in step 3 is DatasheetSub. Adjust the
code to reflect the names of the combo box, the subform control, and the
datasheet subform in your application.
Method 3
Use a subform whose DefaultView property is set to Continuous Forms.
STATUS
Microsoft has confirmed this to be a problem in Microsoft Access versions
7.0 and 97.
REFERENCES
For more information, search the Help Index for "Dropdown method."
Modification Type: | Major | Last Reviewed: | 10/20/2003 |
---|
Keywords: | kbbug kbpending KB181078 |
---|
|