View Full Version : user field selection in a query


Timg
12-17-2001, 02:22 PM
I have a schedule in access with fields like this, Name, Mon, Tue, Wed, etc
I need a way to let the user choose which day is querried. I could make a 7 queries each with the name field and 1 day and let the user choose the querie from a form but I have 3 reports that will based on each day field and i dont want to make 21 reports.
Is there an expression i can write that will let the user enter the table name and source field?

-Tim

Timg
12-17-2001, 05:16 PM
Solved my own problem
Put this expression in the field box of the query
Shedule: IIf([day]="sun",[emphours]![SUN],IIf([day]="MON",[emphours]![MON],IIf([day]="TUE",[emphours]![TUE],IIf([day]="WED",[emphours]![WED],IIf([day]="THUR",[emphours]![THUR],IIf([day]="FR I",[emphours]![FRI],[emphours]![SAT]))))))
When run, the query promts you for "day"
you type in MON, TUE, whatever and it gets the field with that name in table emphours.

-Tim