Page 1 of 2 12 LastLast
Results 1 to 15 of 30
  1. #1
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Hi, your word of wisdom was missing.

    Hi,
    Yes you can send it to me but I can't guarantee when I'll get a chance to look at it as I'm in the middle of trying to sort out a network reconfiguration, an office move and an external audit! I will try and look at it tonight but can't promise anything.
    Regards,
    Rory

    Microsoft MVP - Excel

  2. #2
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hi, your word of wisdom was missing.

    **Post moved to a new thread due to length of the old one - Rory 25/07/2001**
    I've made some strides in the chart matter and now it almost fills the page but I can't set the right margin of the page to .2" like the left margin and so the chart is shifted towards the left of the page.
    This time, even through decompilation, I can't shrink the file size lower than 120k. Can I send it to you, can I, huh, can I, can I, can I? <img src=/S/grovel.gif border=0 alt=grovel width=31 height=23>

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hi, your word of wisdom was missing.

    I've solved the page fitting problem by juggling with margin settings.
    Do you know whether it's possible to put month tick marks(just the ticks, not the tick-mark labels) between the year tick marks on the X axis?

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Hi, your word of wisdom was missing.

    Not that I'm aware of but I confess I don't use graphs a lot in Access as I find them a real pain at times to set up properly!
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hi, your word of wisdom was missing.

    I guess this means you throw in the towel. <img src=/S/igiveup.gif border=0 alt=igiveup width=31 height=23>
    Anyone else who cares to receive the 120k mdb?

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Hi, your word of wisdom was missing.

    I doubt it. The ticks represent the intervals, whether or not they have labels. Your axis would need to be based on month + year to get ticks for months.
    Charlotte

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Hi, your word of wisdom was missing.

    Uh, Rory? Are you using Access 2000 now?
    Charlotte

  8. #8
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Hi, your word of wisdom was missing.

    Yes. I haven't done anything with graphs since Office97 though, which I found to be very trying.
    Regards,
    Rory

    Microsoft MVP - Excel

  9. #9
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hi, your word of wisdom was missing.

    I sort of solved the tick predicament by leaving the X axis based solely on Anno and going into report design view, double-clicking the chart object, right-clicking the X axis, selecting Format Axis, selecting the Scale tab and putting 30(average days in a month) in the "Number of categories between tick marks" box.
    I said "sort of solved" because now I have a tick for every month on the X axis but I'd like the tick corresponding to each year label to be larger than the others so as to "stand out" from the rest but I don't know how to do it.
    I'm also trying to dynamically change the chart title according to the item selected in the List11 combo box on the Mask1 form (see Report_Activate) but when I open the report I get the following error message:
    <font color=red>Run-time error '91': Object variable or With block variable not set.</font color=red>
    What's wrong?
    I guess you'll be able to pinpoint your answer only if I send you the file(212K). Can I? <img src=/S/grovel.gif border=0 alt=grovel width=31 height=23>

  10. #10
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Hi, your word of wisdom was missing.

    OK, but you'll only get an answer here in the public Lounge so that others can benefit from anything I come up with. And I don't use graphs much in Access because I don't like graphs so I avoid them. They've never been anything but funny pictures to me--I prefer to see that data myself.
    Charlotte

  11. #11
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Fair enough

    Any news?

  12. #12
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Fair enough

    Patience, please. I just go it last night, and I haven't had a chance to look at it yet.
    Charlotte

  13. #13
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Fair enough

    You can't do what you're trying to do the way you're trying to do it. Here's a revised Report_Activate routine that at least runs. I added some variable declarations to make it clearer (you should always explicityly declare your variables) and to make it work.

    The error you were getting was because you were referencing XX in a With ... End With but you had never declared it or instantiated it as anything, so the error message was telling you that the object variable wasn't set.

    <pre>Private Sub Report_Activate()
    Dim cmd As ADODB.Command
    Dim cat As ADOX.Catalog
    Dim tbl As Object
    Dim XX As Object
    Dim strTitle As String
    Dim strLabel As String
    Dim strColumn As String
    Dim strSQL As String

    Set XX = Me![XXX]
    Set cat = New ADOX.Catalog
    cat.ActiveConnection = CurrentProject.Connection
    Set cmd = New ADODB.Command

    strSQL = "SELECT mediegio.Anno, mediegio.Mese, mediegio.Giorno, " _
    & "mediegio." & Forms!Mask1!List11.Value & " AS selectedfield, " _
    & "[selectedfield]/24000 AS daypower, [AvgOfPowerday]/1000 AS " _
    & "Avgofdaypower FROM qryProdGiox INNER JOIN mediegio ON " _
    & "(qryProdGiox.Mese = mediegio.Mese) AND (qryProdGiox.Giorno = " _
    & "mediegio.Giorno);"

    <font color=red>'<<one or the other, not both>></font color=red>
    <font color=blue>cmd.CommandText = strSQL
    Set cmd = cat.Views("qrychartMediegio").Command</font color=blue>


    With XX <font color=red>'<<you hadn't instantiated this before</font color=red>
    .HasTitle = True
    If Not Isloaded("Mask1") Then
    MsgBox "Input Form not loaded"
    Else
    <font color=red>'this is broken out for readability only
    'it isn't really necessary to do it this way</font color=red>
    strColumn = Forms!Mask1!List11
    Set tbl = cat.Tables("Mediegio")
    strLabel = tbl.Columns(strColumn).Properties("Description")
    strTitle = "Istogramma delle potenze giornaliere in MW " & strLabel
    .ChartTitle.Text = strTitle
    End If
    End With
    Set tbl = Nothing
    Set cmd = Nothing
    Set cat = Nothing

    End Sub</pre>


    The above code works and the report runs. HOWEVER, you won't get a description added to your graph title *unless* you put a description in the table first! I broke this out into pieces above because I had to track down the problem with description. It didn't occur to me until later to check the table to see whether in fact you had a description for that field. You didn't, so nothing was added to the chart title.

    I don't understand why you had both of these in your code.
    <hr>cmd.CommandText = strSQL
    Set cmd = cat.Views("qrychartMediegio").Command<hr>
    I didn't take either out, but you only need one or the other--they amount to the same thing.
    Charlotte

  14. #14
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Oops, faux pas.

    <hr>there's no trace of "cmd.CommandText = strSQL", where did you see it?<hr>
    It wasn't in your code. I broke it out that way because you had that whole long line of SQL in a single line and I wanted it to be readable when I posted it.

    I personally destroy object variables as soon as they go out of scope. I wasn't sure what you were doing, so I declared an object variable XX to match the name you were using in code. That was a local variable, so it should be destroyed at the end of the routine. Even if it's a public variable, if you were going to use it for a different chart, you should set the instance to nothing because you're going to be setting it to something else later. Otherwise, you're using resources to hold the variable to no purpose, since you've finished with it for that report.

    Declare it as a public Object variable if you must use a public variable. That's what I used in the code, and it works properly. Once you set the variable to the object itself, you have access to the properties and methods of the object, so you shouldn't get the error message.

    I don't generally use public variables because they're resource inefficient and they break easily. It's cleaner to declare them as module level variables and destroy them when they're no longer needed. I make more use of them in VB where the situation is a little different, but in Access I try to avoid them (actually I try to avoid them in VB too).

    I have no clue as to how to do what you want with month labels, and I think it would be too busy anyhow. If you see a graph with what are obviously years separated by 12 tick marks, it's a pretty good bet those represent months and it isn't hard to figure out which is which.
    Charlotte

  15. #15
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Oops, faux pas.

    <img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2>
    Declare it as a public Object variable if you must use a public variable.
    <img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2>
    If, in the Modulo1 module, I substitute "XX as Object" for "XX as Graph.Chart" in the Public declaration section, I still get the message:
    <font color=red>Run-time error '438': Object doesn't support this property or method.</font color=red>

    Text40 text box in the detail section of the ProdGiox report has, as Control Source, the avgofpowerday field with Decimal Places set to 3.
    How come if I change Control Source to =avgofpowerday & " kW", Text40 loses the 3-decimal format and displays numbers with varying decimal places?

    <img src=/w3timages/greenline.gif width=33% height=2><img src=/w3timages/greenline.gif width=33% height=2><img src=/w3timages/greenline.gif width=33% height=2>
    I have no clue as to how to do what you want with month labels, and I think it would be too busy anyhow. If you see a graph with what are obviously years separated by 12 tick marks, it's a pretty good bet those represent months and it isn't hard to figure out which is which.
    <img src=/w3timages/greenline.gif width=33% height=2><img src=/w3timages/greenline.gif width=33% height=2><img src=/w3timages/greenline.gif width=33% height=2>
    Unfortunately those ticks are not the actual representation of the month since, as I said in <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=acc&Number=57795&page=& view=&sb=&o=&vc=1#Post57795>this post </A>, to obtain them I simply went into report design view, double-clicked the chart object, right-clicked the X axis, selected Format Axis, selected the Scale tab and put 30(average days in a month) in the "Number of categories between tick marks" box.
    Well, those are the breaks. I'd like at least the tick mark corresponding to each year label to be larger than the others so as to "stand out" from the rest. Do you know how to do it?
    Ciao

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •