Ac next/ac last (1 Viewer)

mester

Member
Local time
Today, 01:12
Joined
Apr 2, 2020
Messages
63
Hi everyone,
I have a form which it related to a table, in the form, i used button to move next and last. But what i want is moving through my record with condition,all my records in the table seperated in 3 parts, first part has number 1, second part has number 2 and last part has number 3, all those numbers in the table regestred in the company column.
in my form i have a textzone named company's class which contain due to my choose the number 1 or 2 or 3.
So if i choose the number 1, i want from the form if i use the next or last button to show me only the records which have the number 1 in the company column. Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:12
Joined
Oct 29, 2018
Messages
21,467
Hi. And you don't want to simply filter the form to the specific number so all the records are of the same group? If you filter the form, the next and last button should work as expected. Otherwise, look into the FindNext method.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 19:12
Joined
Feb 28, 2001
Messages
27,167
Please be aware that FIRST and LAST rarely work as expected without a little help. IF you drive your form from a query having an ORDER BY clause, then FIRST and LAST have reliable meaning. If you are directly using a table and are not imposing an order in any other way, FIRST and LAST are variable in meaning because under set theory, tables have no inherent order.

I am NOT saying you cannot use FIRST and LAST. I am only warning you that they have been known to cause problems without an ORDER BY clause as part of the process.
 

mester

Member
Local time
Today, 01:12
Joined
Apr 2, 2020
Messages
63
Hi. And you don't want to simply filter the form to the specific number so all the records are of the same group? If you filter the form, the next and last button should work as expected. Otherwise, look into the FindNext method.
Thank you Sir for your help. I am gonna use Findnext method.
 

mester

Member
Local time
Today, 01:12
Joined
Apr 2, 2020
Messages
63
Please be aware that FIRST and LAST rarely work as expected without a little help. IF you drive your form from a query having an ORDER BY clause, then FIRST and LAST have reliable meaning. If you are directly using a table and are not imposing an order in any other way, FIRST and LAST are variable in meaning because under set theory, tables have no inherent order.

I am NOT saying you cannot use FIRST and LAST. I am only warning you that they have been known to cause problems without an ORDER BY clause as part of the process.
Thank you Sir for your help.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:12
Joined
Feb 19, 2002
Messages
43,257
If there is some inherent grouping in the data, you should probably add a grouping table and use a main form with the group table and a subform with the details.
 

Users who are viewing this thread

Top Bottom