Run Query when Last record reached.

Jackpotgee

Registered User.
Local time
Today, 00:04
Joined
Jun 7, 2007
Messages
27
Morning all,

I have a form that is used to view a table of data. When the last record is reached i want to run a query/report.

How would i go about this?

Thanks in advance
 
That's very simple if you're using an unbound form.
But you're probably not.
Perhaps you can use the BeforeInsert event?
 
Yeah the form itself is bound to a query with say 20 records in. The user will preview each record in the query using the navigation buttons to move to the next record. When the form gets to the last record in that query, i want to perform an action, run a report for example.

As i am not actually inserting any data at any point i dont think the before insert would work?

Cheers
 
All sorted.

For anyone else's referrence - i set the allow additions property on the form to no and then included the Openquery action in the Error funtion. i.e.

Code:
Err_Command39_Click:

    DoCmd.OpenReport CMSReport, acPreview
    MsgBox "You have reached the end of the records. Displayed is a report of the data marked to change on CMS"
    
    Resume Exit_Command39_Click
 
Try programming the Current event to determine that you are on the last record and then start your report or whatever.
 

Users who are viewing this thread

Back
Top Bottom