Connecting Tech Pros Worldwide Forums | Help | Site Map

Use of Parameter Query in Code

Thelma Lubkin
Guest
 
Posts: n/a
#1: Nov 13 '05
I have a form that displays and allows user to edit colorsets, each
colorset containing between 3and 11 colors.
Each individual color is a combination of numerical values of
Red,Blue, and Green.

The user can browse the colorsets by going from record to record in
the form. A subform displays the actual colors in the selected
set. The subform's recordset has fields for colorsetname [matched
to colorsetname in the form's recordset], sequenceNumber,
Redvalue,BlueValue and GreenValue, and a record for each color in
each colorset.

The subform displays 11 rectangles: the first n of these should
display the n colors assigned in the Redvalue,etc, fields in
sequence order. Those remaining will default to 'white'.
I've written a query that determines the color of each 'colored'
rectangle in the colorset. It takes as parameters the colorsetname and
sequenceNumber, but I don't know how to incorporate it into code
that will color each rectangle properly for a selected record.

I'd like to be able to do something like
RectsequenceNow.background = someprocess(R,G,B)
where R,G,B are the field values returned by
theQuery with parameters colorNow,sequenceNow determined by
current colorset record and current Rectangle.

thanks for any help,
--thelma


Ted
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Use of Parameter Query in Code


Thelma:
In the OnCurrent event for the sub form, each time you move to a
different record on the main form, the data in the subform changes
based upon the link criteria between the main form and sub form.
Try having the OnCurrent event modify the color values for each
rectangle, then requery/refresh the subform.
Ted

Closed Thread