I have a form (unbound) with 2 sub forms (unbound)
First subform is a datasheet (let's call it DS)
Second subform is data entry (let's call it DE)
After I enter data on DE and save the record, form DS needs to be repopulated and the cursor moved back to the record it was on.
Dim rsTmp As ADODB.Recordset
Dim varBkMrk As Variant
Dim strCompSQL As String
Dim IOD As Long
5 On Error GoTo ErrorHandler
10 varBkMrk = DS.Recordset.Bookmark
15 Set rsTmp = DS.Recordset.Clone
20 rsTmp.Bookmark = varBkMrk
30 strCompSQL = "SELECT * FROM MyView"
35 Set DS.Recordset = OpenSQLRecordset(strCompSQL) 'Function that returns a temp Recordset
40 DS.Recordset.Bookmark = varBkMrk
Error returned: Error 3704 (Operation is not allowed when the object is closed.) Which makes sense because the records in DS are pseudo static
Any ideas on workarounds to get the cursor to move to the correct record?