Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2004
    Posts
    13

    Unanswered: obtaining parameters for a query from a list

    Hello all,
    I want to obtain the parameter for a parametrized query from a combobox.
    I'm using Access 2000 and I know how to write the query but I miss the knowledge for writing the (basic?) code that can do this trick.
    Can someone of you help me out?
    Example :
    table1
    locationnumber (autonum)(key)
    city (text)
    Halltype (num)

    table2
    Hallnumber (autonum)(key)
    description (text)

    Query:
    PARAMETERS hallt Text(25);
    SELECT *
    FROM table1, table2
    WHERE table1.halltype = table2.Hallnumber
    AND table2.description = hallt;

    If I open a report based on this query I have to enter the correct description by hart. Therefore it would be much better if I had a combo box that shows the available descriptions so that I can select the one for my query.
    Many thanks in advance for your help
    Robert

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    make yourself a query.
    forget parameters entirely.
    save your query.

    reopen your query in design view.

    click once in the criteria box of the field you want to set a criteria for.
    click the magic-wand thingie in the tool bar
    navigate in the resulting window through:
    forms
    all forms
    the form you are interested in as a criteria source
    the control that will be your criteria source <--- double-click it

    done! your control .value is now a criteria for the query.

    check out the query in SQL-view so you know how to type this stuff direct next time.

    izy
    Last edited by izyrider; 10-06-04 at 14:37.
    currently using SS 2008R2

  3. #3
    Join Date
    Oct 2004
    Posts
    13
    Hi Izyrider.
    I found out that the best way is to pass the data to a form and than to a report.
    But thanks anyway
    Robert (edadcon)

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    what method did you use for passing the data? late binding?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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