I am trying to requery a control on a main form from an AfterUpdate event of a control on a subform and then return back to the record and control at the subform. Instead i am returned to the first record of the subform.
When i debug, it seems correct, the record i want does show correct at the findfirst statement. but at the form the first record is returned.
Any help would be greatly appreciated.
Here is my current code
Expand|Select|Wrap|Line Numbers
- Private Sub cboVersionType_AfterUpdate()
- Me.Refresh
- Dim Version As Long
- 'set variable to current record ID
- Version = Me.VersionID
- Forms![frm3EstStep1].Form![cboVersionSearch].Requery 'Main form combobox
- 'return form to original record on the subform
- With Me.RecordsetClone
- .FindFirst "VersionID= " & Version
- If .NoMatch Then 'incase another current user deletes the record
- MsgBox "Record not found!", vbCritical
- Else 'go to that record on the subform
- Me.Bookmark = .Bookmark
- End If
- End With
- End Sub