How to the last access record after a requery?

PuddinPie

Registered User.
Local time
Yesterday, 19:07
Joined
Sep 15, 2010
Messages
149
I have a main form that is bassed off of a ticket number. When I access a different form and make changes to the ticket details and requery the main form to show the updated changes it always goes back to the first record. I would like it so that when it requerys the main form stays on the same ticket.
I was looking into a recordsetclone but can't find a go example to learn from and I've tryed forcing the ticket number into the field on the main form after the requery but that did not work either.
Any ideas???
 
i recently started to use this method

Code:
dim tmp as long

tmp = me.recordset.absoluteposition {save the position}

{do your processing stuff here}

me.requery { this puts the cursor back to record 1 - as you know}

me.recordset.absoluteposition = tmp {go back to the saved record number}
so this works fine, as long as you didnt change the number of records in the query. Otherwise there are some other ideas.
 
Sorry but is this put in the main form or in the secondary for that is updating the record?
 
i recently started to use this method

Code:
dim tmp as long

tmp = me.recordset.absoluteposition {save the position}

{do your processing stuff here}

me.requery { this puts the cursor back to record 1 - as you know}

 me.recordset.absoluteposition = tmp {go back to the saved record number}
so this works fine, as long as you didnt change the number of records in the query. Otherwise there are some other ideas.


Hi found this today and gave it a try in a subform which on first try worked out well but as soon as i use it on same/subform form opened from another form it fails to work I have tried opening in different modes but no luck.


im using office 365


Anybody know of another way of moving back to the last record after a requery.
 
Had already tried the bookmark but tried yours but still wouldnt work


It might be down to the code as there is a lot happening in the after update event there's no requery as been though all the code but there is a run cmd save record which I tried removing and it didn't like it lol


thanks for the help
 
Can you attach the db here?
 
Can you attach the db here?


Sorry it's my project manager been trying to solve this one for as long as I can remember strange how it works if it's the only form open though


attachment.php
 

Attachments

  • 2018-12-06 (7).jpg
    2018-12-06 (7).jpg
    108 KB · Views: 285

Users who are viewing this thread

Back
Top Bottom