G
Guest
I have the following crosstab query called [BuyerIn] which is the
recordsource for my form. The purpose of the query is to show the best time
to call my buyers back. It counts how many times I got a hold of them in my
call log table and groups by hour of the day.
What I would like to do is have a button on the form that will update the
form to show when the worst time to call is. Either by changing the
recordsource query to another query with BuyerAtDesk = False, or somehow code
it in sql. I have tried using a parameter in that criteria and linking it to
the grpButtons but have not had any sucess getting it to work in my form.
So, is there a way to change the record source to another query?
Or hard-code the query to run when opening the form?
Thanks,
MikeZz
WHERE (((Buyers.BuyerFilter)=True) AND ((ContactType.BuyerAtDesk)=FALSE))
TRANSFORM Count(Hour([CallLog]![LogTime])) AS Expr1
SELECT DatePart("h",[LogTime]) AS [Order], Format(([LogTime]),"h am/pm") AS
Hours
FROM ContactType INNER JOIN (Buyers INNER JOIN CallLog ON Buyers.BuyerID =
CallLog.BuyerID) ON ContactType.ContactTypeID = CallLog.CallType
WHERE (((Buyers.BuyerFilter)=True) AND ((ContactType.BuyerAtDesk)=True))
GROUP BY DatePart("h",[LogTime]), Format(([LogTime]),"h am/pm"),
Buyers.BuyerFilter, ContactType.BuyerAtDesk
ORDER BY DatePart("h",[LogTime])
PIVOT Buyers.ShortName;
recordsource for my form. The purpose of the query is to show the best time
to call my buyers back. It counts how many times I got a hold of them in my
call log table and groups by hour of the day.
What I would like to do is have a button on the form that will update the
form to show when the worst time to call is. Either by changing the
recordsource query to another query with BuyerAtDesk = False, or somehow code
it in sql. I have tried using a parameter in that criteria and linking it to
the grpButtons but have not had any sucess getting it to work in my form.
So, is there a way to change the record source to another query?
Or hard-code the query to run when opening the form?
Thanks,
MikeZz
WHERE (((Buyers.BuyerFilter)=True) AND ((ContactType.BuyerAtDesk)=FALSE))
TRANSFORM Count(Hour([CallLog]![LogTime])) AS Expr1
SELECT DatePart("h",[LogTime]) AS [Order], Format(([LogTime]),"h am/pm") AS
Hours
FROM ContactType INNER JOIN (Buyers INNER JOIN CallLog ON Buyers.BuyerID =
CallLog.BuyerID) ON ContactType.ContactTypeID = CallLog.CallType
WHERE (((Buyers.BuyerFilter)=True) AND ((ContactType.BuyerAtDesk)=True))
GROUP BY DatePart("h",[LogTime]), Format(([LogTime]),"h am/pm"),
Buyers.BuyerFilter, ContactType.BuyerAtDesk
ORDER BY DatePart("h",[LogTime])
PIVOT Buyers.ShortName;