• Requery and form record (97/SR2)

    Author
    Topic
    #371552

    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 question

    Viewing 0 reply threads
    Author
    Replies
    • #590889

      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.

      • #590947

        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

    Viewing 0 reply threads
    Reply To: Requery and form record (97/SR2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: