Update a form with recently added recordset

Clueless Newbie

Immortal. So far.
Local time
Today, 05:19
Joined
Feb 6, 2004
Messages
48
Hi all!

I'm not entirely sure if mine is a VBA issue or if my thread belongs into the forms forum really. Anyway, here's my problem:

I'm using a pop-up form (Form_Duplikation) in oder to duplicate a recordset. Form_Duplikation is opened and gets its data from the open/current recordset of my main form (Form_Datenerfassung) with an onClick event.

Once I've finished the duplication process, Form_Duplication is automatically closed. After that, I would like to update Form_Datenerfassung with the data of my newly created duplicate, so Form_Datenerfassung will then show the clone instead of the parent recordset. In case the user decides not to go ahead with the duplication, I would also like the main form to remain as it is and still show the parent recordset. Is there a simple way to do this without heaps of code?

Thank you for your patience with me! :) ;)

Ute
 
Thank you, I'll try that out first thing tomorrow morning. :)
 
Well, it didn't quite work as intended, but luckily I have a drop-down list "Auswahl_Name" in Form_Datenerfassung which contains an overview of all recordsets. This came in handy. When the user agrees to the duplification, this is what happens now:

Code:
   If MsgBox("Ihre Auswahl wird nun dupliziert.", vbYesNo + vbCritical, "Achtung") = vbYes Then
        wsp.CommitTrans         ' Änderungen übernehmen.
        TransJA = False
        satz.Close
        MsgBox ("Der Datensatz wurde dupliziert und mit einer neuen ID gespeichert. Sie arbeiten nunmehr mit der Kopie und können diese ändern.")
        MaxID = DMax("[ID]", "daten")
        Form_Datenerfassung!AuswahlName.Requery
        For I = 0 To Form_Datenerfassung!AuswahlName.ListCount - 1
            If MaxID = Form_Datenerfassung!AuswahlName.Column(2, I) Then
                Form_Datenerfassung!AuswahlName.SetFocus
                Form_Datenerfassung!AuswahlName.ListIndex = I
                Exit For
            End If
        Next

A little more code than I had hoped I would need, but it works. Thanks again! :)

Ute
 

Users who are viewing this thread

Back
Top Bottom