How to change query displayed columns from a form combo?

Giganews Newsgroups
Subject: How to change query displayed columns from a form combo?
Posted by:  philyer…@gmail.com
Date: Thu, 17 Jan 2019

Hi,

I'm new to MS Access. I am looking the way I can choose which columns query=
should be displayed in datasheet by choosing the column (field name) from =
a form combo.

The SQL is:
SELECT qryAnalyticsExclClosedDates.CustomerID, qryAnalyticsExclClosedDates.=
Adate, qryAnalyticsExclClosedDates.MDate, WeekdayName(Weekday([adate],2)) A=
S Dateday, TimeValue([adate]) AS [DateTime], qryAnalyticsExclClosedDates. '=
"& [forms]![form1]![enfield1] &"' FROM tblOpHrbyMeterandDay INNER JOIN qryA=
nalyticsExclClosedDates ON tblOpHrbyMeterandDay.CusID =3D qryAnalyticsExclC=
losedDates.CustomerID WHERE (((qryAnalyticsExclClosedDates.MDate) Between f=
orms!form1!DateFrom And forms!form1!DateTo) And ((WeekdayName(Weekday([adat=
e],2)))=3Dopday.value) And ((TimeValue([adate])) Between [starttime] And [e=
ndtime])) ORDER BY qryAnalyticsExclClosedDates.CustomerID;=20

This part referring to the combo box is not working: '"& [forms]![form1]![e=
nfield1] &"'=20

Please help, Thank you

Replies