By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

Parameter query!!!

P: 1
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...
Oct 24 '06 #1
Share this Question
Share on Google+
1 Reply


PEB
Expert 100+
P: 1,418
PEB
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_Value(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_Value(Forms![AskingForm]![WantedField], [ID], "MyTable")
Where you have a Form Named AskingForm with Field named WantedField, and table named MyTable with primary key ID


:)
Oct 27 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.