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:
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****nSQL SQL
DoCmd.SetWarnings True
Fore_ny!subform_rettigheder.Requery
pris = Beregnstor(verdi)
SQL = "update md_tbl_detalje set [Beregnetpris] = " & Str(pris) & " where [detaljeid] = " & Str(verdi)
DoCmd.SetWarnings False
DoCmd****nSQL SQL
DoCmd.SetWarnings True
Prod_ny!Detalje.Requery
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