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

Set individual Text box properties on columnar form 1

Status
Not open for further replies.

jpl458

Technical User
Sep 30, 2009
337
US
Two part question; first-Have a form that was created with form wizard so in design view I only see one text box. When the form opens and executes the query there are many text boxes in a column. I need to set the background color in the text boxes based on the value in the text box. (If Qyantity.value=500 then Quantity.backcolor=vbred end if.) But when the form opens and is updated (It updates every 30 seconds) and one text box reaches the limit all the text boxes turn red. (I see the logic in that since there is only one box in design view. SeemS I need to be able to address the text boxes in form view.)

Second Question; I can only get the click event to cause the event code to execute and change the color, but I want the color change automatically. I have tried all the other events and nothing happen (Change, On Update etc). How can this be done? (Is there an event I am missing?)

Thanks in advance

jpl
 
This kind of thing, in a Datasheet or Continuous View Form (which this has to be, I think, given your description) needs to be done with Conditional Formatting. In Form Design View:
[ul]
[li]Right-Click on the Control to be formatted[/li]
[li]Click on Conditional Formatting[/li]
[li]Under Condition 1 select Expression Is from the dropdown box[/li]
[li]In the Condition Box enter [Quantity] => 500[/li]
[li]Select the formatting you desire using the BackColor (the paint bucket) and/or ForeColor icon(s)[/li]
[li]Click on OK[/li]
[/ul]
The Control's formatting should now be Record-appropriate.

Linq ;0)>


The Missinglinq

Richmond, Virginia

The Devil's in the Details!
 
Thanks. Worked like a dream.

Thanks again

jpl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top