Last Record

  • Thread starter Thread starter Paul Scott
  • Start date Start date
P

Paul Scott

I have a form with a button that when clicked asks if
they want to go back to the form and enter a date or go
to the next record.

The problem I'm having is when they reach the last record
and click the button again it goes to a new record. What
code would I use to keep this from happening?

Thanks for the help,

Paul
 
-----Original Message-----
I have a form with a button that when clicked asks if
they want to go back to the form and enter a date or go
to the next record.

The problem I'm having is when they reach the last record
and click the button again it goes to a new record. What
code would I use to keep this from happening?

Thanks for the help,

Paul
.
Hi Paul,
If users cannot add new records simply change the form
property 'Allow Additions' from yes to no.

If you just want to know whether the current record is the
last record, you could try the following (air code - I
only think it may work)...

***code start***

dim rst as recordset
dim varBookmark as variant

varBookmark=me.bookmark

set rst = me.recordsetclone

rst.movenext
if rst.eof then
' don't move
else
varBookmark=rst.bookmark
end if

me.bookmark=varBookmark

***code end***

Luck
Jonathan
 
Back
Top