Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, UK, Berkshire, England
    Posts
    243
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Requery and form record (97/SR2)

    I've got a form based on a query, which is a main table with left joins to a couple of look-up tables, the user has to enter some values, then run a calculation which also stores some values in one of the look-up tables
    However these values aren't shown on the form, and the only way I've found is to do a .Requery on the form, but this means the record displayed goes back to the first
    - how do I requery the data and still have the current record displayed <img src=/S/question.gif border=0 alt=question width=15 height=15>

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Requery and form record (97/SR2)

    If that update to the lookup tables is merely changing data in existing records, rather than adding new records, than a .Refresh might give you the results you need. Otherwise, you will have to store the ID of the current line (that is, the field values that make this line unique), do the .Requery, then reposition yourself to the "saved" line.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, UK, Berkshire, England
    Posts
    243
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Requery and form record (97/SR2)

    Mark,
    thanks for the response
    The update is both new records and amendments, but I've tried the .Refresh, however it didn't seem to work, but it did prompt me to read the help file and it comments "Since the Refresh method doesn't actually requery the database, the current set won't include records that have been added or exclude records that have been deleted since the database was last requeried."
    The help also mentioned the .Requery so I poked around and along with the .RecordsetClone and a .FindFirst I seem to have got something that works

Posting Permissions

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