Über ein Suchformular Daten an anderes Formular übergeben
Hallo.
Ich stehe im Moment vor einem Rätsel, ich habe ein Suchformular in Access erstellt und wollte die Suche an ein Nachbearbeitungsformular übermitteln. So etwas habe ich schon mal gemacht und hat auch funktioniert. Ich nehme den selben Code wie zuvor und nun bekomme ich eine Fehlermeldung :
laufzeitfehler 91 objektvariable oder with-blockvariable nicht festgelegt
Ich stehe im Moment vor einem Rätsel, ich habe ein Suchformular in Access erstellt und wollte die Suche an ein Nachbearbeitungsformular übermitteln. So etwas habe ich schon mal gemacht und hat auch funktioniert. Ich nehme den selben Code wie zuvor und nun bekomme ich eine Fehlermeldung :
laufzeitfehler 91 objektvariable oder with-blockvariable nicht festgelegt
Private Sub Kombinationsfeld4_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & str(Nz(Me![Kombinationsfeld4], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.OpenForm "Nachbearbeitung"
Forms!Nachbearbeitung.SetFocus
If IsNull(Me!ID) Then
DoCmd.GoToRecord , , acNewRec
Else
Set rs = Forms!Nachbearbeitung.RecordsetClone
rs.FindFirst "ID = " & Me!ID
Forms!Nachbearbeitung.Bookmark = rs.Bookmark
End If
Errorhandler:
If Err = 2450 Then
DoCmd.OpenForm ("Nachbearbeitung")
Resume Next
End If
End Sub
Please also mark the comments that contributed to the solution of the article
Content-Key: 196431
Url: https://administrator.de/contentid/196431
Printed on: April 19, 2024 at 15:04 o'clock