Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Current Record in a SubForm

Status
Not open for further replies.

GGleason

Technical User
Mar 22, 2001
321
US
Using VBA, is it possible to detect where the pointer (current record marker) is at (such as record 7) in a subform?

tia,
GGleason
 

Are you referring to a record id as being record 7 or the records actual position in the displayed dataset?

regards

jo
 
Jo,

It would be the record's actual position in the displayed dataset.

Thanks,
GGleason
 

I have a distant recollection of a rowpos function so I am going to do a quick check on MSDN and make sure I am not getting my languages mixed and post it back

regards

Jo
 

Thought so

what you are after is the .absolutposition property of a records set

a quick way to do this is
on your subform pu an unbound txt box named txtPointer

dim rs as object
dim pntr as variant
set rs= me.recordsetclone
txtpointer = rs.absoluteposition + 1 ('absoluteposition is zero based )

This may go some way to helping you solve your problem
 
I can't get this to work.

Is there a way to get that number that appears on the bottom of the form (that indicates the record number) into code?

Thanks
 
Jim,

Can you tell me where this code is placed?

Thanks,
GGleason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top