Re: Returning to previous record on Scrolling form
- From: "Carl Rapson" <mr.mxyzptlk@xxxxxxxxxxxxxxxxx>
- Date: Fri, 19 Oct 2007 09:17:47 -0500
"Brian" <Brian@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:76B2FBB0-0D4C-4229-BAA3-F65383DA7667@xxxxxxxxxxxxxxxx
I have a very long form with sometimes hundreds of records. For each
record,
there is a text box where the user can enter a quantity to be
added/deleted
to the existing quantity. Once the quantity has been added/deleted, the
form
requeries so that the quantity displayed is now accurate.
Since the form is so long, I want a way for the form to return to the
record
that the user just updated. In Access 2003, I used this code:
dim rst as recordset
dim IntKeyVal as string
IntKeyVal = idx_IDNumber
Application.Echo False
<<<other VBA code here to add/delete from existing quantity>>>
set rst = me.recordsetclone
rst.findfirst IntKeyVal
me.bookmark = rst.bookmark
Application.Echo True
This worked well in Access 2003, but does not work in Access 2007. Access
2007 returns an error that says "Run Time Error '3001' Invalid Argument"
and
when I debug, highlights the rst.findfirst IntKeyVal line. I should point
out that the IntKeyVal value is correct (when I hover over the line to see
the value).
Any help anyone can give would be most appreciated.
Brian
If you're using DAO, try explicitly typing the rst variable:
dim rst as DAO.recordset
Carl Rapson
.
- Follow-Ups:
- Prev by Date: Re: Double Click Field Conflicts
- Next by Date: Re: Using 'like' in a form query
- Previous by thread: More than 1 timer?
- Next by thread: Re: Returning to previous record on Scrolling form
- Index(es):
Relevant Pages
|