Help with code

M

Mattias

Hi

I need help with code wich shall run on a forms onopen event.

1. Look if the current record is the last record..
2. If it is, then close the form
3. If it is not the last record it shall go to next record

Mattias
 
P

PC Datasheet

Mattias,

A form always opens to the FIRST record unless coded to do otherwise so a form
will never open to the last record.


--
PC Datasheet
A Resource for Access, Excel and Word Applications
(e-mail address removed)
www.pcdatasheet.com

· Design and basic development for new applications
· Additions, Modifications and "Fixes" for existing applications
· Mentoring for do-it-yourselfers who want guidance
· Complete application design and development
· Applications Using Palm Pilot To Collect Data And
Synchronize The Data Back To Access Or Excel
 
T

Tony

as PC datasheet said
forms open at first record

but if your looking to see if there is only one record in
the set (ie. first record IS last record) then...

form_open
on error goto ErrNoNext
DoCmd.GoToRecord , , acNext
exit sub
ErrNoNext:
docmd.close
 

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