Unable to set text property of the Charttitle class

  • Follow


I have the following code in my Load event.  I developed it from some code I 
found in grphsm97.mdb on the Microsoft download site.  See bottom of this 
posting for that code.  Unfortunately, when the assignment line executes, I 
get this error.  I'm running Access 2003, and converted the Access 97 
database.

"Unable to set text property of the ChartTitle class"

Is there any way I can change the chart title dynamcially.

My code in the load event.

    Me!Graph23.SetFocus
    Me!Graph23.Charttitle.Text = "new chart title"

The code I found in grphsm97.mdb.
   '--------------------------------------------------
    ' Show or Hide the Title using the Not Operator to
    ' reverse the state ofthe Hastitle property
    '--------------------------------------------------

    Me!Graph1.HasTitle = Not Me!Graph1.HasTitle

    ' If the graph has a title, set the Caption to somthing
    If Me!Graph1.HasTitle Then
        Me!Graph1.charttitle.Text = "Sample Title"
    End If 


0
Reply Laurel 6/24/2007 2:04:48 AM

Try:
Me!Graph23.Charttitle.SetFocus
Me!Graph23.Charttitle.Text = "new chart title"

The control needs to have the focus in order to alter the .Text property.

Laurel wrote:
>I have the following code in my Load event.  I developed it from some code I 
>found in grphsm97.mdb on the Microsoft download site.  See bottom of this 
>posting for that code.  Unfortunately, when the assignment line executes, I 
>get this error.  I'm running Access 2003, and converted the Access 97 
>database.
>
>"Unable to set text property of the ChartTitle class"
>
>Is there any way I can change the chart title dynamcially.
>
>My code in the load event.
>
>    Me!Graph23.SetFocus
>    Me!Graph23.Charttitle.Text = "new chart title"
>
>The code I found in grphsm97.mdb.
>   '--------------------------------------------------
>    ' Show or Hide the Title using the Not Operator to
>    ' reverse the state ofthe Hastitle property
>    '--------------------------------------------------
>
>    Me!Graph1.HasTitle = Not Me!Graph1.HasTitle
>
>    ' If the graph has a title, set the Caption to somthing
>    If Me!Graph1.HasTitle Then
>        Me!Graph1.charttitle.Text = "Sample Title"
>    End If

-- 
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200706/1

0
Reply ruralguy 6/24/2007 2:56:11 PM


This causes the error, "Object does not support this property or method." 
It works OK in the converted grphsm97.mdb, so it can't be my general Access 
environment.  I notice that in both mdb's "charttitle" does not show up in 
the list of attributes when you type the period after Me!Graph23   (or 
Me!Graph1).   But I'm able to change the title in the sample database.  It 
must be some attribute of the chart itself????

"ruralguy via AccessMonster.com" <u12102@uwe> wrote in message 
news:742ea04618f32@uwe...
> Try:
> Me!Graph23.Charttitle.SetFocus
> Me!Graph23.Charttitle.Text = "new chart title"
>
> The control needs to have the focus in order to alter the .Text property.
>
> Laurel wrote:
>>I have the following code in my Load event.  I developed it from some code 
>>I
>>found in grphsm97.mdb on the Microsoft download site.  See bottom of this
>>posting for that code.  Unfortunately, when the assignment line executes, 
>>I
>>get this error.  I'm running Access 2003, and converted the Access 97
>>database.
>>
>>"Unable to set text property of the ChartTitle class"
>>
>>Is there any way I can change the chart title dynamcially.
>>
>>My code in the load event.
>>
>>    Me!Graph23.SetFocus
>>    Me!Graph23.Charttitle.Text = "new chart title"
>>
>>The code I found in grphsm97.mdb.
>>   '--------------------------------------------------
>>    ' Show or Hide the Title using the Not Operator to
>>    ' reverse the state ofthe Hastitle property
>>    '--------------------------------------------------
>>
>>    Me!Graph1.HasTitle = Not Me!Graph1.HasTitle
>>
>>    ' If the graph has a title, set the Caption to somthing
>>    If Me!Graph1.HasTitle Then
>>        Me!Graph1.charttitle.Text = "Sample Title"
>>    End If
>
> -- 
> HTH - RuralGuy (RG for short) acXP WinXP Pro
> Please post back to this forum so all may benefit.
>
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200706/1
> 


0
Reply Laurel 6/24/2007 6:42:17 PM

Sorry Laurel but that was my best guess.  I'm unable to locate the grphsm97.
mdb so I could play with it myself and maybe help.

Laurel wrote:
>This causes the error, "Object does not support this property or method." 
>It works OK in the converted grphsm97.mdb, so it can't be my general Access 
>environment.  I notice that in both mdb's "charttitle" does not show up in 
>the list of attributes when you type the period after Me!Graph23   (or 
>Me!Graph1).   But I'm able to change the title in the sample database.  It 
>must be some attribute of the chart itself????
>
>> Try:
>> Me!Graph23.Charttitle.SetFocus
>[quoted text clipped - 31 lines]
>>>        Me!Graph1.charttitle.Text = "Sample Title"
>>>    End If

-- 
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via http://www.accessmonster.com

0
Reply ruralguy 6/24/2007 7:06:14 PM

I also tried putting it in the click event of a button, and clicked the 
button only after the chart was displaying data.  But that didn't help 
either.

"ruralguy via AccessMonster.com" <u12102@uwe> wrote in message 
news:742ea04618f32@uwe...
> Try:
> Me!Graph23.Charttitle.SetFocus
> Me!Graph23.Charttitle.Text = "new chart title"
>
> The control needs to have the focus in order to alter the .Text property.
>
> Laurel wrote:
>>I have the following code in my Load event.  I developed it from some code 
>>I
>>found in grphsm97.mdb on the Microsoft download site.  See bottom of this
>>posting for that code.  Unfortunately, when the assignment line executes, 
>>I
>>get this error.  I'm running Access 2003, and converted the Access 97
>>database.
>>
>>"Unable to set text property of the ChartTitle class"
>>
>>Is there any way I can change the chart title dynamcially.
>>
>>My code in the load event.
>>
>>    Me!Graph23.SetFocus
>>    Me!Graph23.Charttitle.Text = "new chart title"
>>
>>The code I found in grphsm97.mdb.
>>   '--------------------------------------------------
>>    ' Show or Hide the Title using the Not Operator to
>>    ' reverse the state ofthe Hastitle property
>>    '--------------------------------------------------
>>
>>    Me!Graph1.HasTitle = Not Me!Graph1.HasTitle
>>
>>    ' If the graph has a title, set the Caption to somthing
>>    If Me!Graph1.HasTitle Then
>>        Me!Graph1.charttitle.Text = "Sample Title"
>>    End If
>
> -- 
> HTH - RuralGuy (RG for short) acXP WinXP Pro
> Please post back to this forum so all may benefit.
>
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200706/1
> 


0
Reply Laurel 6/24/2007 7:09:25 PM

http://support.microsoft.com/search/
Put Access in the "product" and "grphsm97.mdb" in the "for."


"ruralguy via AccessMonster.com" <u12102@uwe> wrote in message 
news:7430cf2d892c0@uwe...
> Sorry Laurel but that was my best guess.  I'm unable to locate the 
> grphsm97.
> mdb so I could play with it myself and maybe help.
>
> Laurel wrote:
>>This causes the error, "Object does not support this property or method."
>>It works OK in the converted grphsm97.mdb, so it can't be my general 
>>Access
>>environment.  I notice that in both mdb's "charttitle" does not show up in
>>the list of attributes when you type the period after Me!Graph23   (or
>>Me!Graph1).   But I'm able to change the title in the sample database.  It
>>must be some attribute of the chart itself????
>>
>>> Try:
>>> Me!Graph23.Charttitle.SetFocus
>>[quoted text clipped - 31 lines]
>>>>        Me!Graph1.charttitle.Text = "Sample Title"
>>>>    End If
>
> -- 
> HTH - RuralGuy (RG for short) acXP WinXP Pro
> Please post back to this forum so all may benefit.
>
> Message posted via http://www.accessmonster.com
> 


0
Reply Laurel 6/24/2007 11:46:58 PM

Thanks for the link.  I was looking in the wrong place.  

I think I would try changing your code to:

If Me!Graph23.HasTitle Then
    Me!Graph23.charttitle.Text = "new chart title"
End If

...and see what happens.  


Laurel wrote:
>http://support.microsoft.com/search/
>Put Access in the "product" and "grphsm97.mdb" in the "for."
>
>> Sorry Laurel but that was my best guess.  I'm unable to locate the 
>> grphsm97.
>[quoted text clipped - 13 lines]
>>>>>        Me!Graph1.charttitle.Text = "Sample Title"
>>>>>    End If

-- 
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via http://www.accessmonster.com

0
Reply ruralguy 6/25/2007 12:13:18 AM

Hah!!!!  That did it!!!  I don't see the logic of why this should work and 
nothing else, but it does.  Thanks!!!

"ruralguy via AccessMonster.com" <u12102@uwe> wrote in message 
news:74337d3836024@uwe...
> Thanks for the link.  I was looking in the wrong place.
>
> I think I would try changing your code to:
>
> If Me!Graph23.HasTitle Then
>    Me!Graph23.charttitle.Text = "new chart title"
> End If
>
> ..and see what happens.
>
>
> Laurel wrote:
>>http://support.microsoft.com/search/
>>Put Access in the "product" and "grphsm97.mdb" in the "for."
>>
>>> Sorry Laurel but that was my best guess.  I'm unable to locate the
>>> grphsm97.
>>[quoted text clipped - 13 lines]
>>>>>>        Me!Graph1.charttitle.Text = "Sample Title"
>>>>>>    End If
>
> -- 
> HTH - RuralGuy (RG for short) acXP WinXP Pro
> Please post back to this forum so all may benefit.
>
> Message posted via http://www.accessmonster.com
> 


0
Reply Laurel 6/25/2007 1:24:52 AM

Argghhh!!!!!  I watched your suggestion work.  But it never worked again. 
Even though the charttitle is clearly displayed, I've never again seen 
HasTitle = True so that the setting statement is executed......

I have no idea what's happening.

I do see enough stuff in a Google search of charttitle to be reassured that 
it's in general flakey!

"ruralguy via AccessMonster.com" <u12102@uwe> wrote in message 
news:74337d3836024@uwe...
> Thanks for the link.  I was looking in the wrong place.
>
> I think I would try changing your code to:
>
> If Me!Graph23.HasTitle Then
>    Me!Graph23.charttitle.Text = "new chart title"
> End If
>
> ..and see what happens.
>
>
> Laurel wrote:
>>http://support.microsoft.com/search/
>>Put Access in the "product" and "grphsm97.mdb" in the "for."
>>
>>> Sorry Laurel but that was my best guess.  I'm unable to locate the
>>> grphsm97.
>>[quoted text clipped - 13 lines]
>>>>>>        Me!Graph1.charttitle.Text = "Sample Title"
>>>>>>    End If
>
> -- 
> HTH - RuralGuy (RG for short) acXP WinXP Pro
> Please post back to this forum so all may benefit.
>
> Message posted via http://www.accessmonster.com
> 


0
Reply Laurel 6/25/2007 1:36:04 AM

Try starting off with:
Me!Graph23.HasTitle = True
If Me!Graph23.HasTitle Then
   Me!Graph23.charttitle.Text = "new chart title"
End If


Laurel wrote:
>Argghhh!!!!!  I watched your suggestion work.  But it never worked again. 
>Even though the charttitle is clearly displayed, I've never again seen 
>HasTitle = True so that the setting statement is executed......
>
>I have no idea what's happening.
>
>I do see enough stuff in a Google search of charttitle to be reassured that 
>it's in general flakey!
>
>> Thanks for the link.  I was looking in the wrong place.
>>
>[quoted text clipped - 14 lines]
>>>>>>>        Me!Graph1.charttitle.Text = "Sample Title"
>>>>>>>    End If

-- 
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200706/1

0
Reply ruralguy 6/25/2007 1:48:52 AM

Maybe even:

Me!Graph23.HasTitle = True
Me!Graph23.charttitle.Text = "new chart title"

ruralguy wrote:
>Try starting off with:
>Me!Graph23.HasTitle = True
>If Me!Graph23.HasTitle Then
>   Me!Graph23.charttitle.Text = "new chart title"
>End If
>
>>Argghhh!!!!!  I watched your suggestion work.  But it never worked again. 
>>Even though the charttitle is clearly displayed, I've never again seen 
>[quoted text clipped - 10 lines]
>>>>>>>>        Me!Graph1.charttitle.Text = "Sample Title"
>>>>>>>>    End If
>

-- 
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via http://www.accessmonster.com

0
Reply ruralguy 6/25/2007 1:50:33 AM

Well,  I did get it to happen again, but not consistently.  I had the code 
suggested below in the form's Load event, in the event that actually loaded 
the data in the chart (at the end), in a function called at the end of that 
event, and in a button.  I had different text in each script, so I could be 
sure which executed.  Everyone executed at least once except the code at the 
end of the event loading the graph.  I could never figure out a pattern.  So 
I removed the title and put it on the form.....

Thanks for your help.  You enabled me to decide that it's just too flakey to 
deal with.

"ruralguy via AccessMonster.com" <u12102@uwe> wrote in message 
news:74337d3836024@uwe...
> Thanks for the link.  I was looking in the wrong place.
>
> I think I would try changing your code to:
>
> If Me!Graph23.HasTitle Then
>    Me!Graph23.charttitle.Text = "new chart title"
> End If
>
> ..and see what happens.
>
>
> Laurel wrote:
>>http://support.microsoft.com/search/
>>Put Access in the "product" and "grphsm97.mdb" in the "for."
>>
>>> Sorry Laurel but that was my best guess.  I'm unable to locate the
>>> grphsm97.
>>[quoted text clipped - 13 lines]
>>>>>>        Me!Graph1.charttitle.Text = "Sample Title"
>>>>>>    End If
>
> -- 
> HTH - RuralGuy (RG for short) acXP WinXP Pro
> Please post back to this forum so all may benefit.
>
> Message posted via http://www.accessmonster.com
> 


0
Reply Laurel 6/25/2007 2:02:44 AM

That sounds good to me.  Have fun.

Laurel wrote:
>Well,  I did get it to happen again, but not consistently.  I had the code 
>suggested below in the form's Load event, in the event that actually loaded 
>the data in the chart (at the end), in a function called at the end of that 
>event, and in a button.  I had different text in each script, so I could be 
>sure which executed.  Everyone executed at least once except the code at the 
>end of the event loading the graph.  I could never figure out a pattern.  So 
>I removed the title and put it on the form.....
>
>Thanks for your help.  You enabled me to decide that it's just too flakey to 
>deal with.
>
>> Thanks for the link.  I was looking in the wrong place.
>>
>[quoted text clipped - 14 lines]
>>>>>>>        Me!Graph1.charttitle.Text = "Sample Title"
>>>>>>>    End If

-- 
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200706/1

0
Reply ruralguy 6/25/2007 2:12:15 AM

I had tried that, but I was told that ... well I forget the exact error, but 
I was told I couldn't set HasTitle to true.

"ruralguy via AccessMonster.com" <u12102@uwe> wrote in message 
news:743453272615c@uwe...
> Try starting off with:
> Me!Graph23.HasTitle = True
> If Me!Graph23.HasTitle Then
>   Me!Graph23.charttitle.Text = "new chart title"
> End If
>
>
> Laurel wrote:
>>Argghhh!!!!!  I watched your suggestion work.  But it never worked again.
>>Even though the charttitle is clearly displayed, I've never again seen
>>HasTitle = True so that the setting statement is executed......
>>
>>I have no idea what's happening.
>>
>>I do see enough stuff in a Google search of charttitle to be reassured 
>>that
>>it's in general flakey!
>>
>>> Thanks for the link.  I was looking in the wrong place.
>>>
>>[quoted text clipped - 14 lines]
>>>>>>>>        Me!Graph1.charttitle.Text = "Sample Title"
>>>>>>>>    End If
>
> -- 
> HTH - RuralGuy (RG for short) acXP WinXP Pro
> Please post back to this forum so all may benefit.
>
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200706/1
> 


0
Reply Laurel 6/25/2007 2:18:18 AM

I just put a button on the sample db with basically:

Me!Graph23.HasTitle = True
Me!Graph23.charttitle.Text = "new chart title"

...in the click event and it works *every* time without an error.

Laurel wrote:
>I had tried that, but I was told that ... well I forget the exact error, but 
>I was told I couldn't set HasTitle to true.
>
>> Try starting off with:
>> Me!Graph23.HasTitle = True
>[quoted text clipped - 17 lines]
>>>>>>>>>        Me!Graph1.charttitle.Text = "Sample Title"
>>>>>>>>>    End If

-- 
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200706/1

0
Reply ruralguy 6/25/2007 2:33:57 AM

14 Replies
822 Views

(page loaded in 1.059 seconds)


Reply: