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

colours in the forms

Status
Not open for further replies.

mypeljo

Technical User
Apr 16, 2010
12
BG
n my form I have 2 columns, namely products.office and productsOld.office. They contain prices.They are mostly identical but sometimes they differ.Is it possible, when they are not identical, the row to be red? I know that for forms it is not possible, but maybe I am wrong ?

for example:
namely products.office productsOld.office

545 545
300 200 - in this case to prices to be red?
 

"n my form I have 2 columns"

Are you talking about the UserForm?
2 columns of WHAT? Labels?

If you use labels to display the data, change .ForeColor property of the label to Red.

products.office productsOld.office

545 545
300 [red]200[/red]

Have fun.

---- Andy
 
Assuming that you have a form with a text box for each column. Add a form load event (and probably an after update event to each text box)

Try something like this:


Private Sub Form_Load()

If Me.ProductOfficeTextBox.Value = Me.ProductsOldOfficeTextBox.Value Then

Me.ProductsOldOfficeTextBox.ForeColor = 255

End If

End Sub
 
WaterGeek,
That code might work for the current record as the form opens. It won't update the ForeColor as you move between records and/or update the text box value.

In addition, it looks like the form might be continuous. If this is the case, changing the Forecolor of the text box will change it for every record in the form.

Duane
Hook'D on Access
MS Access MVP
 
dhookum,

Damn! I'v gotten so much from these forums I thought that I finally knew enough to actually help someone else!

I have to admit that i do not realy get the distinction of continuous forms...I have read the help files. Is a contious form the same as datasheet view?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top