Setting SelTop to last record of continuous form 
Author Message
 Setting SelTop to last record of continuous form

I have a bound continuous form.
Is there a simple way to set seltop to the last record?
Sort of...

Me.SelTop = Me.RecordSet(Last)

Hmmm - wishful thinking. There must be a simple way to do this?

I suppose the question is - how do I find out how many records
there are in the recordset behind the form. Have I got to create a
recordset object etc or is there a simpler way of doing this?

Using DAO and Access 2002 with 2000 format.
Many thanks,
Roy



Fri, 03 Jun 2005 06:11:08 GMT  
 Setting SelTop to last record of continuous form
You might try this:

    With Me.RecordsetClone
        .MoveLast
        Me.SelTop = .RecordCount
    End With

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


Quote:
> I have a bound continuous form.
> Is there a simple way to set seltop to the last record?
> Sort of...

> Me.SelTop = Me.RecordSet(Last)

> Hmmm - wishful thinking. There must be a simple way to do this?

> I suppose the question is - how do I find out how many records
> there are in the recordset behind the form. Have I got to create a
> recordset object etc or is there a simpler way of doing this?

> Using DAO and Access 2002 with 2000 format.
> Many thanks,
> Roy



Fri, 03 Jun 2005 07:04:08 GMT  
 Setting SelTop to last record of continuous form
Dirk,
Many thanks for your help. That was pretty simple....
Why do I always forget about RecordsteClone...
Dohh..
Roy


Quote:
> You might try this:

>     With Me.RecordsetClone
>         .MoveLast
>         Me.SelTop = .RecordCount
>     End With

> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com

> (please reply to the newsgroup)



> > I have a bound continuous form.
> > Is there a simple way to set seltop to the last record?
> > Sort of...

> > Me.SelTop = Me.RecordSet(Last)

> > Hmmm - wishful thinking. There must be a simple way to do this?

> > I suppose the question is - how do I find out how many records
> > there are in the recordset behind the form. Have I got to create a
> > recordset object etc or is there a simpler way of doing this?

> > Using DAO and Access 2002 with 2000 format.
> > Many thanks,
> > Roy



Sat, 04 Jun 2005 04:46:27 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. continuous form string record source

2. Detecting new record on continuous form

3. Background Color on Record in Continuous Form

4. Current Record Count in a Continuous Form

5. Move to new record in Continuous Form view?

6. Continuous Forms Active Record Changing

7. How to set continuous form to recordset object??

8. ADODB::Recordset::Move() erroneously setting EOF when moving to last record

9. Error when attempting to update last record of set

10. If last record on a form

11. Opening a Form to the last viewed Record

12. Help: retrieve LAST record on database of 50.000 record

 

 
Powered by phpBB® Forum Software