Results 1 to 1 of 1

Thread: Problem referencing a subform's Bookmark

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2005
    Everett, WA

    Question Problem referencing a subform's Bookmark

    Argh. I'm spinning my wheels on this.

    I have a form that has a subform on it. I'm implementing a quick way to switch records by choosing from a popup form with a treeview list of form/subform records.

    Based on the user's selection, I'm able to extract what record the form should be at and what record the subform should be at. To accomplish this, I'm using rst.Find and then once the proper record is found, I'm creating a bookmark variable.

    The main form's name is frmRecords
    The subform's name is frmMitigSiteInfo
    The name of the subform CONTROL on the main form is sfrMitigSiteInfo

    I can update the bookmark on the main form successfully with this:

    Forms!frmRecords.Bookmark = varProjBookMark
    ..but I'm not having any luck doing the same thing to the subform!

    The closest I can get it to working is this:

    Forms!frmRecords!sfrMitigSiteInfo.Form.Bookmark = varSiteBookMark
    The problem is that 9 times out of 10 it returns an error stating that it is not a valid bookmark. The code I'm using to determine the bookmark for both tables is exactly the same so if it works on the table related to the main form, it SHOULD work on the table related to the subform!

    [BTW, this code resides in an event located on my popup form with the treeview control. That's why I'm specifying a full path to the forms..]

    Any ideas??



    Ugh. I realize why the I'm getting the valid bookmark but don't know how to circumvent it. I failed to realize that, as a subform, the recordset in the subform essentially is based on subset of that subform's entire datasource. So, that datasource may have 50 records but maybe only 5 records are tied to the current record on the main form. This is why my bookmark reference fails.

    My challenge now is how to step through the subform's "subset" to find the record I want..
    Last edited by scole; Apr 21st, 2006 at 06:02 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width