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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

forecolor on validation data in listbox

Status
Not open for further replies.

pinstripe

Programmer
Dec 27, 2004
52
hi,
i have a list box in which i have data from table A , i am adding this data to table B (two tables are not in the relationship) - i would like to mark (with red) all data which are already in the table B when the form starts
code so far:

If IsNull(DLookup("[Stock Code]", "[BOM L1]", ("[Stock Code]= '" & [Forms]![BOM L1]![List100].Column(7) & "' And [Q-Level]= '" & [Forms]![BOM L1]![List100].Column(8) & "'"))) Then

[Forms]![BOM L1]![List100] = vbRed
Else
[Forms]![BOM L1]![List100] = vbBlack
End If



but this is done just for hole list...
where is better to put the code : on formLoad or on BeforeUpdate of listbox
i have try the line: Me.[List100.RowSource.Forecolor= vbRed
but it is not working
thx for help
 
If I understand correct, you are trying to color individual rows of a listbox.. that is not supported by a listbox.
You can use ListView (an activex) for this purpose.
try an advanced search for "ListView Formatting"
regards

Zameer Abdulla
Jack of Visual Basic Programming, Master in Dining & Sleeping
Visit Me
 
I just posted some code to format a listview using indentation and font formatting - see if you can use some of it:

Customizing a ListView

VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
Also Conditional Formatting in ListView thread705-837321

Zameer Abdulla
Jack of Visual Basic Programming, Master in Dining & Sleeping
Visit Me
 
thank you for the tip!
i am now starting to do something with this listview..


the formatting looks great but hopefully all other stuff will work also



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top