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

Mask "0" values in Field 1

Status
Not open for further replies.

yogiyosh

Technical User
Oct 13, 2003
14
GB
help!! I have written a Purchase Order System and have now reached the stage of debugging. Even though this system went "live" a couple of months ago, one (Of many) problems remain. The Most important fields I have are: "QTY", "Description", "Cost" (per unit). The QTY & COST fields calculate fine ([QTY]*[Cost]), but as there are 22 lines for our PO's each field needs to be calculated to produce a final total. Is there a way of setting the default values of QTY & COST to 0 then use a mask to hide any zero value, but still calculate it on the Order Cost???
 
go into the table design and set the default value to "0" for both fields!!!

If the user does not touch these fields then the "0" will not show...
 
Thank you M8KWR for your tip. I've changed the tables as you said, when I raise a Purchase Order The values are still displayed. I've used a word document and embedded it as a report. Next I've overlayed the necessary textboxes, would this make any difference, as the textboxes are just copies from the main table???
 
this may be the Q&D but could you write a bit of code that if the value is "0" then the color of the text is white else black text ?

 
Thank you mustangcoupe for your idea and let me apologise for time taken to respond. People expect me work on more than one project at a time!!!

I've looked at this:
and that seems to make sense also.

This is how I've started writing the code, which I will probably have to insert into all of the controls:
If Me.QTY = 0 Then Me.QTY.Visible = False

At the moment Access doesn't like hiding the control, but I think with a bit of tampering I can resolve the problem.

Any other solutions would be gratefully accepted!!
[2thumbsup]
 
well you are going in the right direction BUT do you want to hide the entire control?

If Me!QTY = 0 Then Me!QTY.Visible = False

or just hide the value of the control

If Me.QTY = 0 Then
Me!QTY.ForeColor = 16777215
ELSE
Me!QTY.ForeColor = -2147483640
end if

assuming the backcolor is white if not use the same color.
 
Mustangcoupe you are a star, that works perfectly!! All I have to do now is change the "On Exit" procedure and it blanks out the value. Thank you very much.
[2thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top