Good morning! 
I have 2 forms (frmRecordList and frmRecordDetails). The form frmRecordList contains 400+ records with a field 'Status' set on "Open".
Normally I choose a record in frmRecordList and frmRecordDetails shows the chosen record. In frmRecordDetails I am able to change a field 'Status' from "Open" into "Closed". When I close frmRecordDetails with the 'Status' "Open" frmRecordList pops up and the shows me the previous selected record at the top in the form. I use the following code which works perfectly:
But if I close frmRecordDetails with the 'Status' "Closed" frmRecordList pops up with the first record at the top because the list only contains records with the 'Status' "Open".
My question:
If I close a record and it disappears from the list, how is it possible to choose automatically the next record with the 'Status' "Open". And how to handle if it was the last record?
I have 2 forms (frmRecordList and frmRecordDetails). The form frmRecordList contains 400+ records with a field 'Status' set on "Open".
Normally I choose a record in frmRecordList and frmRecordDetails shows the chosen record. In frmRecordDetails I am able to change a field 'Status' from "Open" into "Closed". When I close frmRecordDetails with the 'Status' "Open" frmRecordList pops up and the shows me the previous selected record at the top in the form. I use the following code which works perfectly:
Code:
txtID.SetFocus
DoCmd.FindRecord Me.OpenArgs
But if I close frmRecordDetails with the 'Status' "Closed" frmRecordList pops up with the first record at the top because the list only contains records with the 'Status' "Open".
My question:
If I close a record and it disappears from the list, how is it possible to choose automatically the next record with the 'Status' "Open". And how to handle if it was the last record?