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

Negative Figures

Status
Not open for further replies.

sha123

Programmer
Nov 13, 2002
58
0
0
ZA
Please help!
I have a stock dbase with stock levels!
The fields I am working with is 1) Product 2) Stock On Hand.I want the dbase to mark a negative stock count in red(Stock on Hand) and a positive stock count in black!

Is there anyway of achieving that???
 
Hi Sha123

There is a way to do this but I need to understand the type of form you are working from.

If the form is a datasheet, then No - but there are other ways of displaying the information in the way you want.

Tiny


Perfection is Everything
If it worked first time we wont be here!
 
Assuming that Stock on Hand is shown in a text box, you could use this in the forms OnCurrent event:

If Me.(Stock in Hand) < 0 Then
Me.(Stock in Hand).ForColor = vbRed
Else
Me.(Stock in Hand).ForColor = vbBlack
End If

HTH

Nigel
Didn't someone say work is supposed to be fun? They didn't have computers then I guess....
 
It is a Continuous Form! And the stoc on hand is a text box!
 
In thread702-647405 I describe a technique for highlighting a single row of a continuous form based on a condition.

In your case, I think you only want to highlight a single field, but you can use the same technique, but without the need for the background field. Simply apply the conditional formatting to the individual textbox that you wish to manipulate.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top