Last Record

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
 
J

Jonathan Parminter

-----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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top