ACC2002: Combo Box Value Is Blank After You Set Recordset Property (287478)
The information in this article applies to:
This article was previously published under Q287478 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access database (.mdb).
SYMPTOMS
In Microsoft Access, after you set the Recordset property, the text box portion of a combo box may unexpectedly remain blank when you select items from that combo box.
CAUSE
This behavior can occur when the ActiveConnection property of the Recordset uses an ActiveX Data Objects (ADO) connection that was opened by means of the Jet OLEDB provider.
This behavior can also occur when you open a new ADO connection that uses the Jet OLEDB provider, and you assign the ActiveConnection property to the connection by using the following method:
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Data Source").Value = "C:\Northwind.mdb"
.Open
End With
RESOLUTION
To correctly display your selection in the text box portion of the combo box, set the ActiveConnection parameter of the Open method of a Recordset object to the following:
CurrentProject.AccessConnection
In a situation where you have to open your own ADO connection, base your Microsoft Visual Basic code on the following sample code:
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Access.OLEDB.10.0"
.Properties("Data Provider").Value = "Microsoft.Jet.OLEDB.4.0"
.Properties("Data Source").Value = "C:\Northwind.mdb"
.Open
End With
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. REFERENCESFor more information about the Open method, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type open method (ado recordset) in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbbug kbnofix KB287478 |
---|
|