Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Dec 2000
    Location
    Montreal, Quebec, Canada
    Posts
    115
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting a parameter for a query?

    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: <img src=/S/yadda.gif border=0 width=15 height=15>
    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? <img src=/S/shrug.gif border=0 width=39 height=15>
    How do I do that? <img src=/S/question.gif border=0 width=15 height=15>

  2. #2
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Tennessee
    Posts
    194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting a parameter for a query?

    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

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Tennessee
    Posts
    194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting a parameter for a query?

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

    JerryC

  4. #4
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Winnipeg, Canada
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting a parameter for a query?

    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.

Posting Permissions

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