PC Review


Reply
Thread Tools Rate Thread

Bar Graph on Form (rectangle control code)

 
 
dmasch
Guest
Posts: n/a
 
      4th Jan 2010
http://msdn.microsoft.com/en-us/library/dd758785.aspx
This website gives a good description of how to use a small amount of coding
to have a rectangle controlled by a field value on a report appear as a bar
graph when you print preview. I would like to do something very similar,
show a bar graph within a form based on a field's percentage (between 0 and
1). In the example they put the code into the OnFormat event property. I
would like my bar graphs to appear upon opening the form. Hope that I can
use very similar code as in the example but what would I put it in... OnLoad,
OnQuery?

Any suggestions would be most appreciated. Thanks in advance!
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      4th Jan 2010
I'm not certain that it's possible to transfer that technique from a report
to a form. There are some significant differences between how forms and
reports get rendered that may prevent it from working.

What have you tried?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"dmasch" <(E-Mail Removed)> wrote in message
news:03094183-6912-49C1-BF15-(E-Mail Removed)...
> http://msdn.microsoft.com/en-us/library/dd758785.aspx
> This website gives a good description of how to use a small amount of
> coding
> to have a rectangle controlled by a field value on a report appear as a
> bar
> graph when you print preview. I would like to do something very similar,
> show a bar graph within a form based on a field's percentage (between 0
> and
> 1). In the example they put the code into the OnFormat event property. I
> would like my bar graphs to appear upon opening the form. Hope that I can
> use very similar code as in the example but what would I put it in...
> OnLoad,
> OnQuery?
>
> Any suggestions would be most appreciated. Thanks in advance!



 
Reply With Quote
 
Gina Whipp
Guest
Posts: n/a
 
      4th Jan 2010
dmasch,

I have a pie chart on a form that changes based on Customer, Production
Month, Production Year... However, the Bar CHart changes in the
After_Update event of the combo boxes. When the form opens it opens to the
the default of it's RecordSOurce would something like that work for you?
While I can't send it to you (it's embroiled in a larger program) I can
instruct you to it's set-up.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"dmasch" <(E-Mail Removed)> wrote in message
news:03094183-6912-49C1-BF15-(E-Mail Removed)...
> http://msdn.microsoft.com/en-us/library/dd758785.aspx
> This website gives a good description of how to use a small amount of
> coding
> to have a rectangle controlled by a field value on a report appear as a
> bar
> graph when you print preview. I would like to do something very similar,
> show a bar graph within a form based on a field's percentage (between 0
> and
> 1). In the example they put the code into the OnFormat event property. I
> would like my bar graphs to appear upon opening the form. Hope that I can
> use very similar code as in the example but what would I put it in...
> OnLoad,
> OnQuery?
>
> Any suggestions would be most appreciated. Thanks in advance!



 
Reply With Quote
 
Duane Hookom
Guest
Posts: n/a
 
      4th Jan 2010
The code would probably go in the On Current event of the form. However, if
your form is continuous, the results won't be what you want.

--
Duane Hookom
Microsoft Access MVP


"dmasch" wrote:

> http://msdn.microsoft.com/en-us/library/dd758785.aspx
> This website gives a good description of how to use a small amount of coding
> to have a rectangle controlled by a field value on a report appear as a bar
> graph when you print preview. I would like to do something very similar,
> show a bar graph within a form based on a field's percentage (between 0 and
> 1). In the example they put the code into the OnFormat event property. I
> would like my bar graphs to appear upon opening the form. Hope that I can
> use very similar code as in the example but what would I put it in... OnLoad,
> OnQuery?
>
> Any suggestions would be most appreciated. Thanks in advance!

 
Reply With Quote
 
dmasch
Guest
Posts: n/a
 
      5th Jan 2010
Gina, Duane and Douglas,
Thank you all for your replies. Gina, it sounds like you have something very
similar setup. Instuctions would be very helpful, yes.
Basically what I am trying to do is to have a rectangle's width be
controlled by a field on the form that is a percentrank from Excel (0-1 or
0-100%). For this to work the form would need to have a max width that is
100% like from the report example (4 inches). Hopefully this is possible.
Thanks,
dmasch

"Gina Whipp" wrote:

> dmasch,
>
> I have a pie chart on a form that changes based on Customer, Production
> Month, Production Year... However, the Bar CHart changes in the
> After_Update event of the combo boxes. When the form opens it opens to the
> the default of it's RecordSOurce would something like that work for you?
> While I can't send it to you (it's embroiled in a larger program) I can
> instruct you to it's set-up.
>
> --
> Gina Whipp
> 2010 Microsoft MVP (Access)
>
> "I feel I have been denied critical, need to know, information!" - Tremors
> II
>
> http://www.regina-whipp.com/index_files/TipList.htm
>
> "dmasch" <(E-Mail Removed)> wrote in message
> news:03094183-6912-49C1-BF15-(E-Mail Removed)...
> > http://msdn.microsoft.com/en-us/library/dd758785.aspx
> > This website gives a good description of how to use a small amount of
> > coding
> > to have a rectangle controlled by a field value on a report appear as a
> > bar
> > graph when you print preview. I would like to do something very similar,
> > show a bar graph within a form based on a field's percentage (between 0
> > and
> > 1). In the example they put the code into the OnFormat event property. I
> > would like my bar graphs to appear upon opening the form. Hope that I can
> > use very similar code as in the example but what would I put it in...
> > OnLoad,
> > OnQuery?
> >
> > Any suggestions would be most appreciated. Thanks in advance!

>
>
> .
>

 
Reply With Quote
 
Gina Whipp
Guest
Posts: n/a
 
      5th Jan 2010
dmasch,

Yes, it sounds kinda close to what I have... I have to go out for a bit,
but when I come back I am going to break it out of the database it's in and
then I can either send it to you OR, I have decided to put it on my web
site, you can download it. (I decided to do this yesterday when I came
across your question, so I already started.)

With mine, you can make the form any size you want and since the chart is on
the form you can size it any size to fit on the form. Mine also has a way
to print it to a report.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"dmasch" <(E-Mail Removed)> wrote in message
news:6521851D-A8FF-4AC3-9F01-(E-Mail Removed)...
> Gina, Duane and Douglas,
> Thank you all for your replies. Gina, it sounds like you have something
> very
> similar setup. Instuctions would be very helpful, yes.
> Basically what I am trying to do is to have a rectangle's width be
> controlled by a field on the form that is a percentrank from Excel (0-1 or
> 0-100%). For this to work the form would need to have a max width that is
> 100% like from the report example (4 inches). Hopefully this is possible.
> Thanks,
> dmasch
>
> "Gina Whipp" wrote:
>
>> dmasch,
>>
>> I have a pie chart on a form that changes based on Customer, Production
>> Month, Production Year... However, the Bar CHart changes in the
>> After_Update event of the combo boxes. When the form opens it opens to
>> the
>> the default of it's RecordSOurce would something like that work for you?
>> While I can't send it to you (it's embroiled in a larger program) I can
>> instruct you to it's set-up.
>>
>> --
>> Gina Whipp
>> 2010 Microsoft MVP (Access)
>>
>> "I feel I have been denied critical, need to know, information!" -
>> Tremors
>> II
>>
>> http://www.regina-whipp.com/index_files/TipList.htm
>>
>> "dmasch" <(E-Mail Removed)> wrote in message
>> news:03094183-6912-49C1-BF15-(E-Mail Removed)...
>> > http://msdn.microsoft.com/en-us/library/dd758785.aspx
>> > This website gives a good description of how to use a small amount of
>> > coding
>> > to have a rectangle controlled by a field value on a report appear as a
>> > bar
>> > graph when you print preview. I would like to do something very
>> > similar,
>> > show a bar graph within a form based on a field's percentage (between 0
>> > and
>> > 1). In the example they put the code into the OnFormat event property.
>> > I
>> > would like my bar graphs to appear upon opening the form. Hope that I
>> > can
>> > use very similar code as in the example but what would I put it in...
>> > OnLoad,
>> > OnQuery?
>> >
>> > Any suggestions would be most appreciated. Thanks in advance!

>>
>>
>> .
>>



 
Reply With Quote
 
dmasch
Guest
Posts: n/a
 
      5th Jan 2010
Gina, Duane and Douglas,
Thanks for your replies. Gina, it seems that you have a similar solution in
your program. Instructions to set-up would be most helpful, thanks.
Basically I want the rectangle's width to be controlled by a % field on the
form (0-1 or 0-100%). Hopefully this is possible.
Thanks for your help,
dmasch

"Gina Whipp" wrote:

> dmasch,
>
> I have a pie chart on a form that changes based on Customer, Production
> Month, Production Year... However, the Bar CHart changes in the
> After_Update event of the combo boxes. When the form opens it opens to the
> the default of it's RecordSOurce would something like that work for you?
> While I can't send it to you (it's embroiled in a larger program) I can
> instruct you to it's set-up.
>
> --
> Gina Whipp
> 2010 Microsoft MVP (Access)
>
> "I feel I have been denied critical, need to know, information!" - Tremors
> II
>
> http://www.regina-whipp.com/index_files/TipList.htm
>
> "dmasch" <(E-Mail Removed)> wrote in message
> news:03094183-6912-49C1-BF15-(E-Mail Removed)...
> > http://msdn.microsoft.com/en-us/library/dd758785.aspx
> > This website gives a good description of how to use a small amount of
> > coding
> > to have a rectangle controlled by a field value on a report appear as a
> > bar
> > graph when you print preview. I would like to do something very similar,
> > show a bar graph within a form based on a field's percentage (between 0
> > and
> > 1). In the example they put the code into the OnFormat event property. I
> > would like my bar graphs to appear upon opening the form. Hope that I can
> > use very similar code as in the example but what would I put it in...
> > OnLoad,
> > OnQuery?
> >
> > Any suggestions would be most appreciated. Thanks in advance!

>
>
> .
>

 
Reply With Quote
 
dmasch
Guest
Posts: n/a
 
      5th Jan 2010
Hi Gina, Duane and Douglas,
Sorry if this duplicates, I tried replying twice this morning and it still
has not posted. Gina, it seems you have a similar solution in your program,
if you could send instructions for setup that would be great, thanks.
Basically, I want a rectangle's width controlled by a precentage field
within the form. Hopefully this is possible.
Thanks,
dmasch

"dmasch" wrote:

> http://msdn.microsoft.com/en-us/library/dd758785.aspx
> This website gives a good description of how to use a small amount of coding
> to have a rectangle controlled by a field value on a report appear as a bar
> graph when you print preview. I would like to do something very similar,
> show a bar graph within a form based on a field's percentage (between 0 and
> 1). In the example they put the code into the OnFormat event property. I
> would like my bar graphs to appear upon opening the form. Hope that I can
> use very similar code as in the example but what would I put it in... OnLoad,
> OnQuery?
>
> Any suggestions would be most appreciated. Thanks in advance!

 
Reply With Quote
 
Gina Whipp
Guest
Posts: n/a
 
      5th Jan 2010
NEWER USER,

Perhaps you didn't see my reply... I pasted below...

Yes, it sounds kinda close to what I have... I have to go out for a bit,
but when I come back I am going to break it out of the database it's in and
then I can either send it to you OR, I have decided to put it on my web
site, you can download it. (I decided to do this yesterday when I came
across your question, so I already started.)

With mine, you can make the form any size you want and since the chart is on
the form you can size it any size to fit on the form. Mine also has a way
to print it to a report.


--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"dmasch" <(E-Mail Removed)> wrote in message
news:E75C80E6-5473-4346-8E23-(E-Mail Removed)...
> Hi Gina, Duane and Douglas,
> Sorry if this duplicates, I tried replying twice this morning and it still
> has not posted. Gina, it seems you have a similar solution in your
> program,
> if you could send instructions for setup that would be great, thanks.
> Basically, I want a rectangle's width controlled by a precentage field
> within the form. Hopefully this is possible.
> Thanks,
> dmasch
>
> "dmasch" wrote:
>
>> http://msdn.microsoft.com/en-us/library/dd758785.aspx
>> This website gives a good description of how to use a small amount of
>> coding
>> to have a rectangle controlled by a field value on a report appear as a
>> bar
>> graph when you print preview. I would like to do something very similar,
>> show a bar graph within a form based on a field's percentage (between 0
>> and
>> 1). In the example they put the code into the OnFormat event property.
>> I
>> would like my bar graphs to appear upon opening the form. Hope that I
>> can
>> use very similar code as in the example but what would I put it in...
>> OnLoad,
>> OnQuery?
>>
>> Any suggestions would be most appreciated. Thanks in advance!



 
Reply With Quote
 
Duane Hookom
Guest
Posts: n/a
 
      5th Jan 2010
dmasch,
Is this form continuous or single? This is critical information to providing
a solution.

--
Duane Hookom
Microsoft Access MVP


"dmasch" wrote:

> Gina, Duane and Douglas,
> Thank you all for your replies. Gina, it sounds like you have something very
> similar setup. Instuctions would be very helpful, yes.
> Basically what I am trying to do is to have a rectangle's width be
> controlled by a field on the form that is a percentrank from Excel (0-1 or
> 0-100%). For this to work the form would need to have a max width that is
> 100% like from the report example (4 inches). Hopefully this is possible.
> Thanks,
> dmasch
>
> "Gina Whipp" wrote:
>
> > dmasch,
> >
> > I have a pie chart on a form that changes based on Customer, Production
> > Month, Production Year... However, the Bar CHart changes in the
> > After_Update event of the combo boxes. When the form opens it opens to the
> > the default of it's RecordSOurce would something like that work for you?
> > While I can't send it to you (it's embroiled in a larger program) I can
> > instruct you to it's set-up.
> >
> > --
> > Gina Whipp
> > 2010 Microsoft MVP (Access)
> >
> > "I feel I have been denied critical, need to know, information!" - Tremors
> > II
> >
> > http://www.regina-whipp.com/index_files/TipList.htm
> >
> > "dmasch" <(E-Mail Removed)> wrote in message
> > news:03094183-6912-49C1-BF15-(E-Mail Removed)...
> > > http://msdn.microsoft.com/en-us/library/dd758785.aspx
> > > This website gives a good description of how to use a small amount of
> > > coding
> > > to have a rectangle controlled by a field value on a report appear as a
> > > bar
> > > graph when you print preview. I would like to do something very similar,
> > > show a bar graph within a form based on a field's percentage (between 0
> > > and
> > > 1). In the example they put the code into the OnFormat event property. I
> > > would like my bar graphs to appear upon opening the form. Hope that I can
> > > use very similar code as in the example but what would I put it in...
> > > OnLoad,
> > > OnQuery?
> > >
> > > Any suggestions would be most appreciated. Thanks in advance!

> >
> >
> > .
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007: Print Form Control on a full page graph Jeff Microsoft Excel Programming 2 30th Sep 2008 01:58 PM
VB code to check number in Rectangle box =?Utf-8?B?QW50aG9ueQ==?= Microsoft Excel Programming 1 9th Mar 2007 07:35 PM
Code to get a Range RECTangle or PT keepITcool Microsoft Excel Programming 6 12th Aug 2005 06:54 PM
report with Graph Ole object, can I manipulate the datasource of the graph by code? Philip Leduc Microsoft Access Reports 1 27th Jun 2005 11:03 AM
report with Graph Ole object, can I manipulate the datasource of the graph by code? Philip Leduc Microsoft Access 0 23rd Jun 2005 12:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:03 AM.