Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941

    Unanswered: Move to a record

    I'm using AccessXP for my app, with data residing on SQLServer.

    I have a form that I periodically requery while I'm working in it.
    I'd like to get the form to come back to the record I was on when I did
    the requery. I always end up on record 1. Bookmarks are reset whenever you requery, so I can't use that.

    Does anyone have any ideas?

    Thanks
    Inspiration Through Fermentation

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Move to a record

    Originally posted by RedNeckGeek
    I'm using AccessXP for my app, with data residing on SQLServer.

    I have a form that I periodically requery while I'm working in it.
    I'd like to get the form to come back to the record I was on when I did
    the requery. I always end up on record 1. Bookmarks are reset whenever you requery, so I can't use that.

    Does anyone have any ideas?

    Thanks
    This is so fraught with perils ... What happens if the record you're working on gets dropped? What if it's in a different position? Ordinarily I'd say to save off the record # to a local variable and after the requery run a DoCmd.GotoRecord ...

  3. #3
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941

    Re: Move to a record

    Originally posted by M Owen
    This is so fraught with perils ... What happens if the record you're working on gets dropped? What if it's in a different position? Ordinarily I'd say to save off the record # to a local variable and after the requery run a DoCmd.GotoRecord ...
    You are correct in assuming there could be problems. Actually, the current record needing to be dropped is usually the condition that will trigger the requery. I just oversimplified my example, and I can code around all the potential problems. I just can't figure out how to retrieve the current record number, and then move to that number after requerying.

    Thanks
    Inspiration Through Fermentation

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Move to a record

    Originally posted by RedNeckGeek
    You are correct in assuming there could be problems. Actually, the current record needing to be dropped is usually the condition that will trigger the requery. I just oversimplified my example, and I can code around all the potential problems. I just can't figure out how to retrieve the current record number, and then move to that number after requerying.

    Thanks
    Me.CurrentRecord

  5. #5
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941

    Cool

    That's perfect! Thanks for the help.
    I hate when I overlook the obvious.
    Inspiration Through Fermentation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •