C
Chas Large
Hi I have a simple problem with my database that I cannot find a simple
answer to.
I have a button which invokes the VB code
RecNum = CurrentRecordNumber
Me.FilterOn = False
DoCmd.GoToRecord , , acGoTo, RecNum
This gives debug errors as the RecNum is not in fact the current record
number but a value from field in the current record.
If I use acGotoLast or acGotoPrev etc the code works.
I know that the code I need requires me to calculate an offset to add to the
acGoTo so that if I have say 20 records and want to go to the 15th RecNum
should = 15.
Now what I need is to be able to determine what the current record count is
so I can use this as the offset.
Why go to all this trouble I hear you ask, well this all comes from a form
where the user searches for a record via a filter, the trouble is that when
the filter is closed the records in the form jumps back to the beginning.
I just need to be able to jump immediately back to the last record that was
viewed/edited.
Hope this explanation makes sense.
--
Cheers
Chas
***************
* Spectrum is Green *
***************
answer to.
I have a button which invokes the VB code
RecNum = CurrentRecordNumber
Me.FilterOn = False
DoCmd.GoToRecord , , acGoTo, RecNum
This gives debug errors as the RecNum is not in fact the current record
number but a value from field in the current record.
If I use acGotoLast or acGotoPrev etc the code works.
I know that the code I need requires me to calculate an offset to add to the
acGoTo so that if I have say 20 records and want to go to the 15th RecNum
should = 15.
Now what I need is to be able to determine what the current record count is
so I can use this as the offset.
Why go to all this trouble I hear you ask, well this all comes from a form
where the user searches for a record via a filter, the trouble is that when
the filter is closed the records in the form jumps back to the beginning.
I just need to be able to jump immediately back to the last record that was
viewed/edited.
Hope this explanation makes sense.
--
Cheers
Chas
***************
* Spectrum is Green *
***************