Hello,
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
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
.fi "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
If CurrentProject.AllForms("frm4EstTypes").IsLoaded Then
DoCmd.Close acForm, "frm4EstTypes"
End If
End Sub
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
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
.fi "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
If CurrentProject.AllForms("frm4EstTypes").IsLoaded Then
DoCmd.Close acForm, "frm4EstTypes"
End If
End Sub