Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Oct 2002
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Move subform to a record (2000)

    When I click on a record on a subform I want another subform to move to the same record. I'm having a problem determining the technique required to accomplish this. Any tips?

    Thanks,

    Howard

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Move subform to a record (2000)

    What do you mean by "the same record"?

    If the subforms have the same record source, so that their records are actually the same, there seems to be little point in having two subforms.

    If you mean that they have a field in common on which you want to "match" the subforms, you might use the technique described in ACC2000: Using Code to Dynamically Synchronize Two Forms. Since you're working with subforms instead of standalone forms, you'll need to modify the way the form is referred to. Microsoft's example uses

    Set frm = Forms(formname)

    where formname is a string variable holding the name of the form to be synchronized. Replace this by

    Set frm = Forms(formname).Controls(subformcontrol).Form

    where formname now must hold the parent form name, and subformcontrol the name of the second subform control (this is not necessarily the same as the name of the subform in the database window).

  3. #3
    Lounger
    Join Date
    Oct 2002
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Move subform to a record (2000)

    Thanks for the reply Hans. The subforms are on separate tabs. One subform is used to search and the other is used for entry. I want to click on a found record on the search form and have the entry form 'move' to that record.

    Howard

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Move subform to a record (2000)

    The method (plus link) in my previous reply should do what you want, although I admit I haven't actually tested it for subforms. By the way, the OnCurrent event handler should be applied to the search subform.

Posting Permissions

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