That is correct. Here is the crosstab SQL:
PARAMETERS [Forms]![frmMainScheduler]![SelectedDate] DateTime;
TRANSFORM Max(qryDailyInstallSched.[Scheduled?]) AS [MaxOfScheduled?]
SELECT qryDailyInstallSched.Time
FROM qryDailyInstallSched
GROUP BY qryDailyInstallSched.Time
PIVOT qryDailyInstallSched.Installer;
which is built off of:
SELECT qryInstallerTimeSlots.Installer, qryInstallerTimeSlots.Time,
IIf([qryScheduledInstalls]![ScheduleTime]=[qryInstallerTimeSlots]![Time],[qryScheduledInstalls]![MID],[qryInstallerTimeSlots]![SheduleDate])
AS [Scheduled?], qryScheduledInstalls.ScheduleDate
FROM qryInstallerTimeSlots LEFT JOIN qryScheduledInstalls ON
(qryInstallerTimeSlots.Time = qryScheduledInstalls.ScheduleTime) AND
(qryInstallerTimeSlots.Installer = qryScheduledInstalls.Installer);
"qryScheduledInstalls" is the query that actually references the form
field
SelectedDate. What I'm attempting to build is a scheduling form that
shows
time slots, installers and jobs assigned for a particular day. The
field
on
the main form has the day that I want to display. The subform would
look
something like:
Bob Sue Tom
8:00 Open Open Open
8:30 Job 1 Open Open
9:00 Open Job 2 Open
9:30 Open Open Open
10:00 Job 3 Open Open
. . . .
. . . .
. . . .
Thanks for taking a look.
Steve
:
It's a bit difficult to trouble-shoot without seeing the SQL view of
the
query. Are you suggesting there is no problem displaying the datasheet
view
of the query from the database window?
--
Duane Hookom
MS Access MVP
Duane,
I used your code for a subform and it works great except for one
problem.
One of the queries that I used to build my Crosstab uses the value
from
a
field on the main form. I added it as a paramter to my Crosstab and
the
query works fine, but nothing shows up in the subform. No error,
just
nothing.
Thanks for any insight.
Steve
:
There is a sample mdb "dynamsubfrm.mdb" at
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane
which
demonstrates how to set a subform to a crosstab query. This is
actually
using the query object as the subform so it can only be displayed
as a
datasheet.
--
Duane Hookom
MS Access MVP
I have a subform based on a crosstab query. I get the following
error
message: "You can't use a pass through query or a non-fixed
column
crosstab
query as record source for a subform or subreport. Before you
bind
the
subform o subreport to a crosstab query, set the query's
columnheadings
property." I have tried, even using the Help menu, to figure out
how
to
"set
the query's columnheadings property" in order to fix the problem,
but I
couldn't. Could someone help with that?
Thanks in advance,