[AccessD] Access 2007:

Darryl Collins Darryl.Collins at coles.com.au
Thu Apr 2 22:23:26 CDT 2009



For those whom maybe interested.

I used a small function on many forms to let the user know which record is selected out of all records.
It shows up on the form as such "Record 5 of 625" in a text box.

The code below works in earlier versions, but not in Access 2007:
'============= RESET RECORD VS ROW COUNTER ==================
Public Function GetRecordText() As String
        GetRecordText = CStr([CurrentRecord]) & " of " & Cstr([RecordsetClone].[RecordCount])"
End Function
'============================================================

Access 2007 doesn't seem to like RecordSetClone?

This code works in all versions (although it seems slower to calculate it, at least on my PC).
'============= RESET RECORD VS ROW COUNTER ==================
Public Function GetRecordText() As String
    GetRecordText = CStr(Recordset.AbsolutePosition + 1) + " of " & CStr(Recordset.RecordCount)
End Function
'============================================================

cheers
Darryl



This email and any attachments may contain privileged and confidential information
and are intended for the named addressee only. If you have received this e-mail in
error, please notify the sender and delete this e-mail immediately. Any
confidentiality, privilege or copyright is not waived or lost because this e-mail
has been sent to you in error. It is your responsibility to check this e-mail and
any attachments for viruses.  No warranty is made that this material is free from
computer virus or any other defect or error.  Any loss/damage incurred by using this
material is not the sender's responsibility.  The sender's entire liability will be
limited to resupplying the material.





More information about the AccessD mailing list