Having a little trouble getting this code to work.
Using a command button to requery a field on the main form and keep the place in the subform.
This works fine if there is a record in the subform, but get an error if there are no records.
How can I bypass the bookmark portion of the code and just requery the MainFormField when there are no records in the subform to bookmark.
Using a command button to requery a field on the main form and keep the place in the subform.
This works fine if there is a record in the subform, but get an error if there are no records.
Code:
Dim strBookmark As String
strBookmark = Me.[SubformName].Form.Bookmark
Me.MainFormField.Requery
Me.[SubformName].Form.Requery
Me.[SubformName].Form.Bookmark = strBookmark
How can I bypass the bookmark portion of the code and just requery the MainFormField when there are no records in the subform to bookmark.