Problem with Recordset.FindNext

keawee

Registered User.
Local time
Today, 23:41
Joined
Jul 8, 2003
Messages
16
Hello,

I 've a form with most textbox and one button to search and one button to find the next record. My code search perfectly the first record because i use with my recordset FindFirst. My problem is when i have double and i want to display the next record and the next record... . I can use with my recordset FindNext but only once time. I can't click one more and i would like a routine to find the next record. Could you please have a look in my base.

The form which name Form_Administration_Main
I use the field "Numéro Série" to search
I insert in this field the number "19518" ( I have three records)

Thanks

Keawee
 

Attachments

if you use the wizard, it can create for you a Find Next button.
 
Hello maxmangion,

I 'm agree with you but i would like use the VBA code in my Base. I can find the first record, I can find the second record with the method FindNext but I don't know how can I do if I have more two records. Whan i click on my button next, i can do it just one time. Is there are a solution to do it one more by code?.

Thanks for your help

Keawee
 
well if i were you i would still use the wizard to get the base of the code needed, and then try to alter it accordingly to suit exactly your needs.
 
keawee,

Why on Earth are you using unbound forms !?

They are much more difficult.

1) Do Not Use "On Error Resume Next", it will make debugging very
difficult.

2) To check for the Search Results, don't use Err.Number. The lack
of records will not return an error. If there are no records rs.EOF will
be true.

3) The Search is OK and returns a recordset. That recordset should be
Global to your form. You will need it for the next step.

4) When the user hits the "Next Record" button, you should NOT open
up a new recordset, you should just do a rs.MoveNext in the "Global"
recordset that the Search returned.

It really is much easier to use a "bound" form and let Access handle all
of the record manipulation.

Wayne
 

Users who are viewing this thread

Back
Top Bottom