RE: Error setting Rowsource using VBA for Chart



Thank-you so much! This works beautifully and now the knots on my head can
heal from me banging my head on the wall. :-)

Have a great day!

Laurie

"Duane Hookom" wrote:

I try to avoid messing with Row Sources of charts any time after a report has
been opened. You might want to base the chart on a saved query. Then use some
DAO code to change the SQL property of the query prior to opening the report.

strSQL ="SELECT Category, Count(Category) AS CountOfCategory, " & _
"Rebuild, SetupCheckInDate " & _
"FROM qryProgramLoadRebuildInfoFull " & _
"WHERE Category & ''<>'' And Category<>'N/A' AND " & _
"Rebuild=True AND SetupCheckInDate Like '1/*2007*' " & _
"GROUP BY Category, Rebuild, SetupCheckInDate "
CurrentDb.QueryDefs("qselForChart").SQL = strSQL

If SetupCheckInDate is really a date field, I would not use a string
comparison.
--
Duane Hookom
Microsoft Access MVP


"Laurie Loves Automation" wrote:

I have a report that contains an unbound Microsoft Graph Chart. I want the
chart's row source to be set based on a query plus some user input from a
previous screen. I've tried putting the code in the Activate() Event, Open()
Event, and Page() event and I get errors on all of them. The Activate and
Open events don't even seem to see my report and I'm thinking it's because
it's not technically "open" at the time they run...? The Page event gives me
a different error that I can't set the Rowsource property after "printing"
has started (I'm not printing... does this mean something different?).
Anyhow, I really need to get this to work. Any suggestions?

Here is my code:

Reports!rptRebuildByCategory!OLERebuildByCategory.RowSource = "SELECT
qryProgramLoadRebuildInfoFull.Category,
Count(qryProgramLoadRebuildInfoFull.Category) AS CountOfCategory,
qryProgramLoadRebuildInfoFull.Rebuild,
qryProgramLoadRebuildInfoFull.SetupCheckInDate FROM
qryProgramLoadRebuildInfoFull GROUP BY
qryProgramLoadRebuildInfoFull.Category,
qryProgramLoadRebuildInfoFull.Rebuild,
qryProgramLoadRebuildInfoFull.SetupCheckInDate HAVING
(((qryProgramLoadRebuildInfoFull.Category)<>"" And
(qryProgramLoadRebuildInfoFull.Category)<>'N/A') AND
((qryProgramLoadRebuildInfoFull.Rebuild)=True) AND
((qryProgramLoadRebuildInfoFull.SetupCheckInDate) Like '1/*2007*'))"

Thanks,

Laurie

.



Relevant Pages

  • RE: Error setting Rowsource using VBA for Chart
    ... "Duane Hookom" wrote: ... DAO code to change the SQL property of the query prior to opening the report. ... If SetupCheckInDate is really a date field, I would not use a string ... has started (I'm not printing... ...
    (microsoft.public.access.reports)
  • Re: Epson Stylus Colour 880 banding lines.
    ... Sadly, this sounds like the "stuck nozzle" issue which there seems only one real fix for, a new head. ... If this type of printing occurs outside of the margins of the image, raising the paper thickness lever doesn't help lessen or eliminate it, or it may dissappear when you use lower resolution printing, that implies the problem is as I stated above. ... The 880 is a 4 color printer, and the last one with no chip in the cartridge to prevent refilling, it isn't considered "photographic" although you'd be hard pressed to know by looking at normal viewing distances. ... If I'm looking at replacing both of these, what would be a good photograph printer choice with regard to both quality output, speed and cartrage replacement costs. ...
    (comp.periphs.printers)
  • Re: Epson Stylus Colour 880 banding lines.
    ... If this type of printing occurs outside of the margins of the image, raising the paper thickness lever doesn't help lessen or eliminate it, or it may dissappear when you use lower resolution printing, that implies the problem is as I stated above. ... The 880 is a 4 color printer, and the last one with no chip in the cartridge to prevent refilling, it isn't considered "photographic" although you'd be hard pressed to know by looking at normal viewing distances. ... many head cleans and a driver update have not resolved this problem. ... If I'm looking at replacing both of these, what would be a good photograph printer choice with regard to both quality output, speed and cartrage replacement costs. ...
    (comp.periphs.printers)
  • Re: Printer leaves smudges
    ... thicker paper does have an impact on the ability of a printer to feed ... correctly but envelopes have an added complication. ... The printer head may need cleaning to remove excess ink. ... complicated by the need to get to the head's printing surface. ...
    (microsoft.public.windowsxp.print_fax)
  • Re: Display records based on count value of one field
    ... The subquery idea never entered my head. ... pointer to the correct forum to use.... ... you can easily build a query that has a common syntax. ...
    (microsoft.public.access.queries)