Help with code

  • Thread starter Thread starter Mattias
  • Start date Start date
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
 
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
 
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
 
Back
Top