ACC95: "No current record" Using AddAllToList() FunctionID: Q138976
|
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.
The combo box or list box RowSource property is set to a table, a query, or an SQL statement that returns no records.
To work around this problem, follow these steps:
Case acLBGetRowCount
' Return number of rows in recordset.
rst.MoveLast
AddAllToList = rst.RecordCount
Case acLBGetRowCount
' Return number of rows in recordset.
On Error Resume Next
rst.MoveLast
AddAllToList = rst.RecordCount + 1
Else
rst.MoveFirst
rst.Move lngRow
Else
rst.MoveFirst
rst.Move lngRow - 1
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.
"Return No Records"
Keywords : kberrmsg kbusage DcmSltn
Version : 7.0
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: April 28, 1999