The problem I have been tearing my hair off, is that I want SubFormA to be requeried (not refreshed, due some calculated fields in the form datasource) , if I update a record in SubFormB. The requery part works flawless, but I want to reselect the Order record the user had selected, because a requery will jump to 1st record by default.
I am trying to achieve this with Bookmarks and I am receiving "Not a valid bookmark" error. I am using the "After Update" event in SubFormB to call the procedure RefreshVenueEstimate (see code) to refresh SubFormA.
Expand|Select|Wrap|Line Numbers
- Sub RefreshVenueEstimate()
- Dim rst As DAO.Recordset
- Dim VenueMaterialEstimateID As Long
- VenueMaterialEstimateID = Me.Parent.Child_Venue_Material_Estimates!id
- Me.Parent.Child_Venue_Material_Estimates.Form.Requery
- Set rst = Me.Parent.Child_Venue_Material_Estimates.Form.RecordsetClone
- rst.FindFirst "id = " & VenueMaterialEstimateID
- If Not rst.NoMatch Then
- Me.Parent.Child_Venue_Material_Estimates.Form.Bookmark = rst.Bookmark
- End If
- rst.Close
- Set rst = Nothing
- End Sub