473,748 Members | 2,274 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help creating a 'legend'

In one of my tables, in addition to a text field that is a Description
field, there are two fields for color formatting the data in reports.
They are Longs and hold the foreground and background color values that
the Description in that record should be displayed in. For example, the
following records might exist...
Bass - 255 - 16777215 (The word BASS displayed red on white)
Carp - 65535 - 0 (The word CAR displayed yellow on black)
Fish - 33023 - 8388672 (The word FISH displayed orange on purple)
There could be any number of records, most likely 10-15 but could be
more or less.
I would like to be able to display a legend on one of my forms that
displays each Description formatted with its given fore/back color
combination. I have taken a stupid pill and can't figure out how to do
this. Can anyone help me here please?

Sep 20 '06 #1
8 3366
On Wed, 20 Sep 2006 17:14:43 -0400, Swans, What Swans?
<fz@barkingpump kin.ooowrote:

I'm assuming you know how to create a subreport.
Then to color each field, write code in the OnFormat event. Something
like:
txtFishName.Bac kColor = BackColor
txtFishName.For eColor = ForeColor

BackColor and ForeColor would be columns in your query that this
(sub)report is bound to.

-Tom.

>In one of my tables, in addition to a text field that is a Description
field, there are two fields for color formatting the data in reports.
They are Longs and hold the foreground and background color values that
the Description in that record should be displayed in. For example, the
following records might exist...
Bass - 255 - 16777215 (The word BASS displayed red on white)
Carp - 65535 - 0 (The word CAR displayed yellow on black)
Fish - 33023 - 8388672 (The word FISH displayed orange on purple)
There could be any number of records, most likely 10-15 but could be
more or less.
I would like to be able to display a legend on one of my forms that
displays each Description formatted with its given fore/back color
combination. I have taken a stupid pill and can't figure out how to do
this. Can anyone help me here please?
Sep 21 '06 #2
In article <j9************ *************** *****@4ax.com>, no.spam.tom7744
@cox.net says...
On Wed, 20 Sep 2006 17:14:43 -0400, Swans, What Swans?
<fz@barkingpump kin.ooowrote:

I'm assuming you know how to create a subreport.
Then to color each field, write code in the OnFormat event. Something
like:
txtFishName.Bac kColor = BackColor
txtFishName.For eColor = ForeColor

BackColor and ForeColor would be columns in your query that this
(sub)report is bound to.

-Tom.

In one of my tables, in addition to a text field that is a Description
field, there are two fields for color formatting the data in reports.
They are Longs and hold the foreground and background color values that
the Description in that record should be displayed in. For example, the
following records might exist...
Bass - 255 - 16777215 (The word BASS displayed red on white)
Carp - 65535 - 0 (The word CAR displayed yellow on black)
Fish - 33023 - 8388672 (The word FISH displayed orange on purple)
There could be any number of records, most likely 10-15 but could be
more or less.
I would like to be able to display a legend on one of my forms that
displays each Description formatted with its given fore/back color
combination. I have taken a stupid pill and can't figure out how to do
this. Can anyone help me here please?

I have actually considered a sub-report however the sizing is an issue.
How do I set it so that the report displays on the screen in the size I
want it? Cant get it to do what I want. AFAIK I have to have a print
driver for whatever printer is going to generate the report and then
find a paper size that I want to use, format it all to fit and it just
does not work. I have an area about 2=3F" wide to fit this legend. I
have yet to find a printer that supports 2=3F" paper width. I really may
be a total dumb ass on this and maybe I am missing something obvious,
but I need an answer that will be a universal fix w/o and requirements
such as a specific printer.
Sep 21 '06 #3
In article <j9************ *************** *****@4ax.com>, no.spam.tom7744
@cox.net says...
On Wed, 20 Sep 2006 17:14:43 -0400, Swans, What Swans?
<fz@barkingpump kin.ooowrote:

I'm assuming you know how to create a subreport.
Then to color each field, write code in the OnFormat event. Something
like:
txtFishName.Bac kColor = BackColor
txtFishName.For eColor = ForeColor

BackColor and ForeColor would be columns in your query that this
(sub)report is bound to.

-Tom.

In one of my tables, in addition to a text field that is a Description
field, there are two fields for color formatting the data in reports.
They are Longs and hold the foreground and background color values that
the Description in that record should be displayed in. For example, the
following records might exist...
Bass - 255 - 16777215 (The word BASS displayed red on white)
Carp - 65535 - 0 (The word CAR displayed yellow on black)
Fish - 33023 - 8388672 (The word FISH displayed orange on purple)
There could be any number of records, most likely 10-15 but could be
more or less.
I would like to be able to display a legend on one of my forms that
displays each Description formatted with its given fore/back color
combination. I have taken a stupid pill and can't figure out how to do
this. Can anyone help me here please?

Also, I was not aware you could put a subreport on a form. I hadnt ever
tried that. When I use the subform/report tool on a form all it allows
me to do is display a subform.
Sep 21 '06 #4
....assuming that these values are dynamic, I know of no "simple" way to do
this

....as always, when in need of doing something difficult, see www.lebans.com

....the SubClassFormatB yCriteria sample mdb should give you what you need.

....hth

William Hindman

<Swans>; "What Swans?" <fz@barkingpump kin.ooowrote in message
news:MP******** *************** @newsgroups.com cast.net...
In one of my tables, in addition to a text field that is a Description
field, there are two fields for color formatting the data in reports.
They are Longs and hold the foreground and background color values that
the Description in that record should be displayed in. For example, the
following records might exist...
Bass - 255 - 16777215 (The word BASS displayed red on white)
Carp - 65535 - 0 (The word CAR displayed yellow on black)
Fish - 33023 - 8388672 (The word FISH displayed orange on purple)
There could be any number of records, most likely 10-15 but could be
more or less.
I would like to be able to display a legend on one of my forms that
displays each Description formatted with its given fore/back color
combination. I have taken a stupid pill and can't figure out how to do
this. Can anyone help me here please?

Sep 21 '06 #5
On Thu, 21 Sep 2006 01:42:21 -0400, Swans, What Swans?
<fz@barkingpump kin.ooowrote:

No you can't. I picked up on your "...two fields for color formatting
the data in reports..." and figured you wanted to create a report.
Upon second reading of your OP I am confused. You want color
formatting in reports, but the legend in a form???

-Tom.
>In article <j9************ *************** *****@4ax.com>, no.spam.tom7744
@cox.net says...
>On Wed, 20 Sep 2006 17:14:43 -0400, Swans, What Swans?
<fz@barkingpum pkin.ooowrote:

I'm assuming you know how to create a subreport.
Then to color each field, write code in the OnFormat event. Something
like:
txtFishName.Ba ckColor = BackColor
txtFishName.Fo reColor = ForeColor

BackColor and ForeColor would be columns in your query that this
(sub)report is bound to.

-Tom.

>In one of my tables, in addition to a text field that is a Description
field, there are two fields for color formatting the data in reports.
They are Longs and hold the foreground and background color values that
the Description in that record should be displayed in. For example, the
following records might exist...
Bass - 255 - 16777215 (The word BASS displayed red on white)
Carp - 65535 - 0 (The word CAR displayed yellow on black)
Fish - 33023 - 8388672 (The word FISH displayed orange on purple)
There could be any number of records, most likely 10-15 but could be
more or less.
I would like to be able to display a legend on one of my forms that
displays each Description formatted with its given fore/back color
combination. I have taken a stupid pill and can't figure out how to do
this. Can anyone help me here please?


Also, I was not aware you could put a subreport on a form. I hadnt ever
tried that. When I use the subform/report tool on a form all it allows
me to do is display a subform.
Sep 21 '06 #6
In article <mM************ *************** ***@adelphia.co m>,
wd*******@adelp hia.net says...
...assuming that these values are dynamic, I know of no "simple" way to do
this

...as always, when in need of doing something difficult, see www.lebans.com

...the SubClassFormatB yCriteria sample mdb should give you what you need.

...hth

William Hindman

<Swans>; "What Swans?" <fz@barkingpump kin.ooowrote in message
news:MP******** *************** @newsgroups.com cast.net...
In one of my tables, in addition to a text field that is a Description
field, there are two fields for color formatting the data in reports.
They are Longs and hold the foreground and background color values that
the Description in that record should be displayed in. For example, the
following records might exist...
Bass - 255 - 16777215 (The word BASS displayed red on white)
Carp - 65535 - 0 (The word CAR displayed yellow on black)
Fish - 33023 - 8388672 (The word FISH displayed orange on purple)
There could be any number of records, most likely 10-15 but could be
more or less.
I would like to be able to display a legend on one of my forms that
displays each Description formatted with its given fore/back color
combination. I have taken a stupid pill and can't figure out how to do
this. Can anyone help me here please?



Yes thats it. The data are printed and formatted (colored) in the main
report. This report is displayed on the form with the snapshot viewer
control. I would like to add to the form (as opposed to the bottom of
the report as a report or page footer) a legend of the color scheme for
the data displayed in the snapshot.
Sep 21 '06 #7
Swans wrote:
Bass - 255 - 16777215 (The word BASS displayed red on white)
Carp - 65535 - 0 (The word CAR displayed yellow on black)
Fish - 33023 - 8388672 (The word FISH displayed orange on purple)
I would like to be able to display a legend on one of my forms that
displays each Description formatted with its given fore/back color
combination. I have taken a stupid pill and can't figure out how to do
this. Can anyone help me here please?

HAve you tried the on format event in the detail section?

Assuming:

1) your field names are fdFish, fdFore, fdBack;

2) a report bound to a query of the fish and colour table; and

3) you have a text box called txtDisplay with a controlsource of fdFish.

Try the following in the detail on format event:

Private Sub Detail_Format(C ancel As Integer, FormatCount As Integer)

Me.txtDisplay.B ackColor = Me.fdBack.Value
Me.txtDisplay.F oreColor = Me.fdFore.Value

End Sub

It works just fine in the quick test I just did.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Sep 21 '06 #8
Tim Marshall wrote:
HAve you tried the on format event in the detail section?
Disregard - my suggestion was for a report, not a form.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Sep 21 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5232
by: Jorl Shefner | last post by:
I've only been able to plot data with both symbols and lines by issuing two plot commands, one for markers and one for lines. That's perfectly fine, but it creates a problem when I try to create a legend for it. For some reason, the legend command by default alternates between using symbols and lines, grabbing displaying the symbol from the first plot command for the first series, then displaying a line type from the second plot for the...
1
3169
by: Jorl Shefner | last post by:
I have a problem that I run into a lot with the 'legend' command's default behavior. I've found a work-around but I wonder if there's a better way. For a simple example, take the following: ________________________________ x= a= b=
1
1894
by: Philip | last post by:
Hi, I am trying to output certain nodes inside another. I have an xml template with field definitions for a form, and this includes textfields, labels, checkboxes etc plus fieldssets. I defined them like this: >>>> XML SNIPPET >>>> <fields>
1
4617
by: Mitch | last post by:
I am using Access to create an Excel spreadsheets with graphs related to rows on the sheet1 to the graph on sheet2. I am using the same data but different subsets of the data to make different spreadsheets for different groups. The spreadsheet formats are the same for each of the different groups. So I am using a loop to requery the data for the different groups and create a new spreadsheet for each group. The three graphs on sheet 2...
5
10146
by: dubing | last post by:
Hi, We have some html source like this: <div class="survey"> <form action="students/cbe-graduate-students/survey.html" method="post" id="frmPbSurvey"> <fieldset class="survey_item"> <legend class="question"><span class="questionNumber">6.</span>If the
11
4089
by: Dirntknow | last post by:
Further to my recent post in this newsgroup i've got to admit i'm struggling. I've no experience with javascript or it's workings. What i'd like is a simple converter to allow a user to input the distance travelled in miles and the time in hours and minutes, the result being an average speed. What i'd appreciate is for someone to write the script for me and post here if possible. I am willing to learn but don't know where to start and i've...
3
1696
by: bdbeames | last post by:
Ok I have a form validation problem that I need one of you javascript ninja s to help me with. The following is a form with the javascript that I have used for the last year or two to validate. It works quite nicely and I like the way it works. The problem is I am working on a site where the html needs to validate using STRICT. This form doesn't validate with STRICT because I use a name on the form and not and id. Could someone show me...
10
7420
by: dkyadav80 | last post by:
<html> /// here what shoud be java script for: ->when script run then not display all input text field only display selection field. ->when user select other value for institute only this field display not display degree text field ->when user select other value in the selection field for degree then text field display and wise versa //// <bodly> <table>
2
1332
by: Hvid Hat | last post by:
Hi Can anyone help me with the following transition? My problem is how to create a fieldset each time I run into a heading and then include the following text elements within the fieldset. <?xml version="1.0" encoding="ISO-8859-1"?> <field> <heading>First heading</heading> </field>
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9552
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8245
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.