check for eof in a query

yogi

Registered User.
Local time
, 19:27
Joined
Mar 26, 2007
Messages
47
Hi everyone

when I open my form i SET UP A QUERY IN THE CONTROL SOURCE that would only selected records that I wanted. That part work fine. The problem that I have its when i get to the last record , how do you determine that you are at the last filtered record?
 
If the control source of the form has a query that pulls ONLY the records you want, the form will control that; nothing else necessary.
 
the problem i have is lets presume that I have 5 records selected in my query.
i have a button on my form to advance to the next record. so when I get to the 5 record and press the buttom next record its create a blank record all the time.
i don't used recordset so i do i determine that i'm pointing to the lat record of my query?
 
If you don't want new records added that way, set the form's AllowAdditions property to No. Then, put a separate button on the form to set AllowAdditions to True if you want to give your users a way to add records, but not have the navigation buttons go there themselves.
 
thnaks for your help, its work fine. I didn't want the user to add more records., but i still have a problem.

when I press the next record buttom(on the last record of the filter table) its gave me a error of "you can't go to the specified record". What is the best way to trap that error ?
 
In the error handler for the button, add the bolded parts shown around your existing error handler code:

If Err.Number <> 2105 Then
...Your existing error handler is here
End If
 
thanks for all of your help

do you know how to de-activate keys on the keyboard?
 

Users who are viewing this thread

Back
Top Bottom