Parameter query!!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • biljana
    New Member
    • Oct 2006
    • 1

    Parameter query!!!

    Hi!

    Could somebody help me to create simply parameter query?

    I need query like this:

    select [column_name] from table_name;

    column_name should be parameter from combo box or user can type column name.

    Thanks...
  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #2
    Hi,

    If the user type the colum it's not just like a parameter query!

    In your combobox you can create a list with thwe fields in your table, your query will be parameter query

    But not only parameter one! ;)

    Imagine that this column has multiple rows not just one...

    Maybe you want to visualize all records of the respective column?

    So sure that you need a user defined function written on VB like:

    Function return_field_Va lue(Fiel, ID_row, Table)

    Can you define at your own?

    A simillar code I've posted in the forum... If you don't find it I'll type it again..

    And than you need to use the ready function in your query

    Than your parameter in the query will be
    return_field_Va lue(Forms![AskingForm]![WantedField], [ID], "MyTable")
    Where you have a Form Named AskingForm with Field named WantedField, and table named MyTable with primary key ID


    :)

    Comment

    Working...