Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Highlight specific record in a continuous form 1

Status
Not open for further replies.

stephenk1973

Technical User
Jun 11, 2003
246
GB
I have a continuous sub form for which i need to highlight only specific records which are held in a table.

My coding to do this is currently in the 'On Current' event of the sub form. This returns a 1 or 0 depending recordcount from a query against the table.

What seems to occur is the code completes against the first record of the sub form and highlights/doesn't highlight everything as per the first record.

How do i get this to work against each individual line of the continuous form?
 
I am using Access 2000.

I looked into the conditional formatting but is doesn't allow me to query a table in order to get my yes/no criteria.

Ideally i would like every field in the row highlighted (7 fields in each row). Reading down the continuous form, field values may repeat, but the overall record will be unique.

The fields in each record line are being used to generate a query the result of which i want to determine whether the row is to be highlighted or not. Currently the subform uses the first record and formats all the rows according to its result.

Thanks

Stephen

 
Hi

OK, you know what you want better than I, but conditional formatting is set on a control on a form, I do not see what that has to do with table or query, the control can just as easily be bound to a derived column in a query as a 'normal' column in a table.

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
I have a sample where a person did this.

He placed a giant textbox the entire length of the record in the subform. Make sure all your textboxes for the fields have a transparent background.

In the control source of this txtBox put:

=IIf([SelTop]=[ctlCurrentLine],"ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ",Null)

Set the back color of this giant textbox to transparent as well. This will make the selected record a sky blue.

Sean.
 
First off you need to go back to basics and think through what you're asking and to remember the difference between Forms and Reports. ( This sort of thing is easy in Reports precisly because the event has been placed in the Report Object model to cope with it. )


When you DESIGN a continuous form you see ONE row of it.
All controls on a 'continuous form' that are UNBOUND are simply copied from one row to the next when the form builds.
If you want controls to act differently from Row to Row then you need to BIND then to a field in the underlying table.

So you have options:-
1) Set the Back Colour of each bound control in the row to the desired colour one at a time.

2) Add a Text box control bound to the Unique Id for the underlying table.
Make this control fill the entire height and width of the subform Detail section and in the format tab select "Send to Back" so that all other controls appear on top of it.
Then set the BackColour of this control as desired.



'ope-that-'elps.





G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top