Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Location
    Virginia
    Posts
    16

    Question Unanswered: Filter main form by element of subform

    Simply, I have a form, we'll call it MainForm. On MainForm is SubForm.

    There is also a Form2. Form2 has a combo box from which the user will select an item and push the command button. Once the button has been pushed, I would like it to reference a field on the SubForm, and in turn, change the contents of the MainForm.

    Example:

    MainForm
    --> Project Details
    SubForm
    --> Lists software used in project.

    Form2
    --> Combo containing software choices

    User selects value from Combo on Form2. Compares selected value to Subform value named SOFT_PKG_NAME. If values are equal, allow user view entire MainForm data.

    I guess part of the question would be... can the subform control the contents of the main form?

    I hope this makes sense... I'll clarify any questions.

    Thanks!

  2. #2
    Join Date
    Mar 2003
    Location
    London
    Posts
    40

    Re: Filter main form by element of subform

    Yes,

    Assuming this is code for the command button on Form2

    if me.combo.value = me.parent.subform.controls("SOFT_PKG_NAME").value then

    'Here you want to access main form's controls
    me.parent.controls(<Name of the control you want to access>)
    ' and so on
    end if


    Originally posted by TinLemon
    Simply, I have a form, we'll call it MainForm. On MainForm is SubForm.

    There is also a Form2. Form2 has a combo box from which the user will select an item and push the command button. Once the button has been pushed, I would like it to reference a field on the SubForm, and in turn, change the contents of the MainForm.

    Example:

    MainForm
    --> Project Details
    SubForm
    --> Lists software used in project.

    Form2
    --> Combo containing software choices

    User selects value from Combo on Form2. Compares selected value to Subform value named SOFT_PKG_NAME. If values are equal, allow user view entire MainForm data.

    I guess part of the question would be... can the subform control the contents of the main form?

    I hope this makes sense... I'll clarify any questions.

    Thanks!

Posting Permissions

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