Hello,
I have a form [frm paymentsentry] that has a subform launched from a button to enter in payments or fees. When the users closes that subform, I have the mainform requery using [Forms]![frm PaymentsEntry].Requery on the On Click event. The problem is that then the mainform is reset back to the first record, even if they were entering in on the 100th.
I found thread702-1067302 which mentions a similiar problem and obtained and modified this code to try an accomplish this:
Dim rst As DAO.Recordset, pkName As String, pkHold
pkName = "BookingNumber"
pkHold = Me(pkName)
[Forms]![frm PaymentsEntry].Requery
Set rst = Me.RecordsetClone
rst.FindFirst "[" & pkName & "] = '" & pkHold & "'"
Me.Bookmark = rst.Bookmark
Set rst = Nothing
DoCmd.Close acForm, "sfrmPaymentEntryPopup"
When I run this, it tells me there is No current record. When I check the record where the entry was made, the entry is there. The final post on that thread was that he made some modifications to it since he was running it from a subform. I have done what I can, but dont know what else needs modified.
I have a form [frm paymentsentry] that has a subform launched from a button to enter in payments or fees. When the users closes that subform, I have the mainform requery using [Forms]![frm PaymentsEntry].Requery on the On Click event. The problem is that then the mainform is reset back to the first record, even if they were entering in on the 100th.
I found thread702-1067302 which mentions a similiar problem and obtained and modified this code to try an accomplish this:
Dim rst As DAO.Recordset, pkName As String, pkHold
pkName = "BookingNumber"
pkHold = Me(pkName)
[Forms]![frm PaymentsEntry].Requery
Set rst = Me.RecordsetClone
rst.FindFirst "[" & pkName & "] = '" & pkHold & "'"
Me.Bookmark = rst.Bookmark
Set rst = Nothing
DoCmd.Close acForm, "sfrmPaymentEntryPopup"
When I run this, it tells me there is No current record. When I check the record where the entry was made, the entry is there. The final post on that thread was that he made some modifications to it since he was running it from a subform. I have done what I can, but dont know what else needs modified.