Selasa, 24 Juli 2012

[MS_AccessPros] Error 3021

 

Good morning! I am getting Error 3021 "No current record" with the MoveFirst line of the following code when I try to use Filter by Form. How would I work around this?

Thanks!
Connie

' Provide a record counter for using with custom navigation buttons (when not using
' Access built in navigation)
'http://www.databasedev.co.uk/navigation-record-count.html
Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone

With rst
.MoveFirst
.MoveLast
lngCount = .RecordCount
End With

'Show the result of the record count in the text box (RecordNbr)
If Me.NewRecord Then
Me.RecordNbr = "New" _
& vbNewLine & " OF " _
& vbNewLine & lngCount

Else: Me.RecordNbr = Me.CurrentRecord _
& vbNewLine & " OF " _
& vbNewLine & lngCount
End If

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar