Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2009
    Location
    Gatineau, Quebec Canada
    Posts
    147
    Provided Answers: 1

    Unanswered: Setting Rowsource on Form_Load.

    Greetings again (sigh),

    I am redoing the database of a sailing school. Essentially, I have a table called parent, and a table called children. In the form for "parents", I have a listbox with all of the children. I load the listbox on form_load thus:

    lstEleve.RowSource = "select ID, lname, fname from children where par_id =" [Forms]![frmStart]!cboParents.

    "cboParents" is a combobox on "frmStart". This works fine as long as I call the parent form from "frmStart" (which has the combobox. However, I want to also call the same parent form from the form for one of their children ('frmEVOEleve"), which has a hidden text box containing the parent's ID number.

    In short, I need to change the rowsource depending on which form calls the parent form. IE:

    Called from the combobox in "frmStart":

    lstEleve.RowSource = "select ID, lname, fname from children where par_id =" [Forms]![frmStart]!cboParents.

    Called from "frmEVOEleve:

    lstEleve.RowSource = "select ID, lname, fname from children where par_id =" [Forms]![frmEVOEleve]!txtParentId.value.

    How do I do this?

    Regards

    J Smith
    Aylmer, QC

  2. #2
    Join Date
    Mar 2009
    Location
    Gatineau, Quebec Canada
    Posts
    147
    Provided Answers: 1

    Patience (sign)

    The solution is to pass an argument (openargs) on docmd.openform.

    memo to self: more patience before asking questions.

    J. Smith
    Aylmer, QC

Posting Permissions

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