Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2005

    Unanswered: ye ole Requery and Gotorecord thing

    EDIT: Found the solution in an old database of mine... using Reorcclone and Bookmark.

    Since I'm having serious strenous endeavours using the search feature, I'm hoping someone can repost from an old thread, the solution of how to return to the current record after a requery.

    Observe my code:

        rek = Prod_ny!Detalje!txt_detid
        verdi = Prod_ny!Detalje!txt_detid
        pris = Beregnstortilskuer(verdi)
        tal = Prod_ny!Detalje!txt_id
        forestilling = Prod_ny!Detalje.Form.CurrentRecord
        SQL = "update md_tbl_forestilling set [pris pr tilskuer] = " & Str(pris) & " where [forestilling id] = " & Str(tal)
        DoCmd.SetWarnings False
        DoCmd.RunSQL SQL
        DoCmd.SetWarnings True
        pris = Beregnstor(verdi)
        SQL = "update md_tbl_detalje set [Beregnetpris] = " & Str(pris) & " where [detaljeid] = " & Str(verdi)
        DoCmd.SetWarnings False
        DoCmd.RunSQL SQL
        DoCmd.SetWarnings True
        DoCmd.GoToRecord acDataForm, , acGoTo, forestilling
    As you can see, the form in which I have to return to the current record, is a subform. For some odd reason the GotoRecord believes the form (if name is added to the gotorecord parameters) isn't open... so I'm kinda stuck here.

    The subform's data is a simple query with master/child link on an id.

    Cheers, Trin
    Last edited by Trinsan; 09-13-06 at 05:54.
    IT squid: networks, servers, firewalls, routers and I dabble a little with SQL-server and Access as well....

  2. #2
    Join Date
    Dec 2004
    Madison, WI
    My first thought is a refresh command somewhere but I'm wondering if you can't just set the recordsource of the query on the subform = to the primary key of the main form and then instead of using gotorecord command, just set the recordsource = "queryname".
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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