• Getting a parameter for a query?

    Author
    Topic
    #353950

    Access 2000.
    I have five tables: Project(80), Offices(30), PerformanceIndicators(20), Scales(5), Data.
    Each PerformanceIndicator is assigned one of the 5 different scales.
    The Data file is used to match projects with offices with indicators and to assign a value to the indicator.
    All fields in the Data file are lookup fields with combo boxes to facilitate data entry:
    Project ID shows the project names, saves the selected project ID
    Office ID shows the office names, saves the selected office ID
    Indicator ID shows the indicator names, saves the selected indicator ID

    Since the Indicator is already known by the time the user gets to the Value field, I would like to have the proper ScaleValues assigned to the combo box to facilitate selection.

    Here is my logic:
    1) I remember the IndicatorID after is has been selected
    2) Find the corresponding record in the Indicator file
    3) Retrieve the assigned ScaleID
    4) Use a query to display (combo box) the corresponding Scale values from the Scale file
    5) Save the value in the Value field

    Does this make sense?
    How do I do that?

    Viewing 0 reply threads
    Author
    Replies
    • #519425

      go to the rowsource of the ScaleValues combo box
      click on the three dotted box to the left
      this will bring up a query builder you can set whatever criteria you want here
      HTH
      JerryC

      • #519497

        sorry the box is to the right of the rowsource not to the left

        JerryC

      • #519517

        Hi,

        In addition, when you select a value from cboList1, you can use its AfterUpdate event to apply the Requery method of cboList2 (which has the SQL statement to find the data based on your first choice).

        You can immediately populate cboList2 by this code:

        Me.cboList2 = Me.cboList2.ItemData(0)

        If you have a specific value in mind for cboList2, you can loop through cboList2 till you find it (or NOT) and take appropriate measures depending on outcome.

    Viewing 0 reply threads
    Reply To: Getting a parameter for a query?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: