Requerying a Scrolling Form

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

I have a scrolling form with about 5000 records. Whenever
someone updates a record, they would like the data on the
scrolling form to also be updated. I in VBA behind
the "Close" button on the data entry form, I use forms!
[<formname>].requery to requery the scrolling form and all
is well. Except...my users don't want the scrolling form
to return to the 1st record. Does anyone know how to
program in VBA a way to requery the scrolling form and
without returning the form to the 1st record...or requery
and somehow automatically scroll the form back down to the
last record edited?
 
You can do this two ways - one is to cache the primary key of the current
record by saving it in a local variable before the requery, then after the
requery, use that value to find the record.

Another somewhat easier way is to use the GetSetSB functions by Stephen
Lebans to Get and Set the scrollbar:
http://www.lebans.com/setgetsb.htm
 
Back
Top