ACC95: "No current record" Using AddAllToList() Function (138976)
The information in this article applies to:
- Microsoft Access for Windows 95 7.0
This article was previously published under Q138976 SYMPTOMS
Advanced: Requires expert coding, interoperability, and multiuser skills.
When you use the AddAllToList() function provided in the sample database
Solutions.mdb to add (All) items to a combo box or list box list, you may
receive the following error message:
No current record.
CAUSE
The combo box or list box RowSource property is set to a table, a query,
or an SQL statement that returns no records.
RESOLUTION
To work around this problem, follow these steps:
- Open the Solutions.mdb database without running its AutoExec macro. To
do so, press SHIFT while you open the database.
- Open the AddAllToListModule module.
- In the Procedure list box on the toolbar, select AddAllToList.
- Modify the section of code that reads
Case acLBGetRowCount
' Return number of rows in recordset.
rst.MoveLast
AddAllToList = rst.RecordCount
to read:
Case acLBGetRowCount
' Return number of rows in recordset.
On Error Resume Next
rst.MoveLast
AddAllToList = rst.RecordCount + 1
- Modify the section of code that reads
Else
rst.MoveFirst
rst.Move lngRow
to read:
Else
rst.MoveFirst
rst.Move lngRow - 1
- Save the module and close the database.
STATUS
Microsoft has confirmed this to be a problem in Microsoft Access version
7.0. This problem no longer occurs in the AddAllToList code provided in the
Solutions database that comes with Microsoft Access 97.
Modification Type: | Major | Last Reviewed: | 11/17/2000 |
---|
Keywords: | kbbug kberrmsg kbusage KB138976 |
---|
|