Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    139

    Unanswered: Getting Value from Subform

    I'm trying to open/launch a form from a subform and set the value of an ID field to match the ID field of the subform so they're linked . I've done this many times between regular forms (non subforms) without difficulty, for example:

    Forms!SalesDetail.MICustID = Forms!MICustListForm.CUST_NUMBER

    When I substitute a subform on the right side of the equation, I always get a "Unable to locate the form" type of error. I'm sure there's an obvious answer, looking forward to finding it out.

    Thanks,

    Beeyule
    Thanks,
    Bill

  2. #2
    Join Date
    Apr 2002
    Location
    Illinois
    Posts
    133
    I just learned this. Reference the field in the subform via the parent form:

    Forms!ParentForm!SubForm!field

    Use the name of the subform control in the parent form, not the form name of the subform.
    SteveH

  3. #3
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465

    Re: Getting Value from Subform

    Originally posted by beeyule
    I'm trying to open/launch a form from a subform and set the value of an ID field to match the ID field of the subform so they're linked . I've done this many times between regular forms (non subforms) without difficulty, for example:

    Forms!SalesDetail.MICustID = Forms!MICustListForm.CUST_NUMBER

    When I substitute a subform on the right side of the equation, I always get a "Unable to locate the form" type of error. I'm sure there's an obvious answer, looking forward to finding it out.

    Thanks,

    Beeyule
    You can do this to:
    Forms!SalesDetail.MICustID = Forms![YourMainForm]![YourSubform]![YourControl]
    I hope this help you.
    Saludos
    Norberto

Posting Permissions

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