Show Field in query if Check box = Yes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have set up a form for a Bus timetable which has a selection for Day and
Locations which uses a Check Box method, i.e if you want a trip on a monday
select yes and which time points did you want listed. The trouble i am having
is the fields that are not selected are still showing in the query.

How can i get the query to only show fields that are selected through the
Check box.
 
It really sounds like you have a normalization issue. However, you haven't
provided much information about your tables, fields, form(s), or anything
else. Can you provide some sample records and what you would like to display
in a form or report?
 
DayType Mildura SwanHill Bendigo Melbourne - these are fields
Monday 9:00 10:00 12:00 13:30
Tuesday 9:00 10:00 12:00 13:30

The above is in a table called tbl TimeTable, the form is based on check
boxes (yes\no) and the information is saved in tbl SelectedTimeTable. The
query uses tbl TimeTable and under each field is a IIF statement ie IIf([tbl
Select TimepointsUp]![Monday]=Yes,"Monday"). This works fine for the field
Daytype and shows the Time Table information. The problem that i have is that
i do not know how to only show the timepoints selected. If the person only
selects Mildura and Melbourne for Time table information i do not want
SwanHill or Bendigo showing.

Cheers
Mike
 
I would create a timetable with records like
DayNum Stop StopTime
1 Mildura 9:00
1 SwanHill 10:00
1 Bendigo 12:00
....
2 Melbourne 13:30
You can then query the specific records you need.

--
Duane Hookom
MS Access MVP

Mike B said:
DayType Mildura SwanHill Bendigo Melbourne - these are fields
Monday 9:00 10:00 12:00 13:30
Tuesday 9:00 10:00 12:00 13:30

The above is in a table called tbl TimeTable, the form is based on check
boxes (yes\no) and the information is saved in tbl SelectedTimeTable. The
query uses tbl TimeTable and under each field is a IIF statement ie
IIf([tbl
Select TimepointsUp]![Monday]=Yes,"Monday"). This works fine for the field
Daytype and shows the Time Table information. The problem that i have is
that
i do not know how to only show the timepoints selected. If the person only
selects Mildura and Melbourne for Time table information i do not want
SwanHill or Bendigo showing.

Cheers
Mike
Duane Hookom said:
It really sounds like you have a normalization issue. However, you
haven't
provided much information about your tables, fields, form(s), or anything
else. Can you provide some sample records and what you would like to
display
in a form or report?
 
Back
Top