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

Conditional Formatting on FORM

Status
Not open for further replies.

99Chuck99

Programmer
Dec 11, 2003
67
US
Does anybody see any errors in this code. I have this code on a onclick trigger. No errors but field data does not change color or font to bold. Any help would be great.
Thanks
Chuck

Private Sub DESCRIPTION_Label_Click()

Dim objFrc As FormatCondition
Dim lngRed As Long

lngRed = RGB(255, 0, 0)

Me![JON].FormatConditions.Delete

Set objFrc = Me![JON].FormatConditions.Add(acFieldValue, _
acEqual, "NL5EEP00")

With Me![JON].FormatConditions(0)
.FontBold = True
.BackColor = lngRed
End With

End Sub
 
I think you need to reference a control in your code.
For example:
Code:
With forms("forms1").Controls("Textbox1").FormatConditions(1)
    .BackColor = RGB(255,255,255)
    .FontBold = True
    .ForeColor = RGB(255,0,0)
End With

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
Thanks Genomon,
I'll give it a try and let you know....
 
Hi, I'm new here so please take it easy on me. I have built a new database with a web access page. the database is a equipment log db. On the webpage the user enters the event and all the info. what I have been trying to do is have it send me an e-mail. From the forms page it works just fine with a command button. when i made the web access page the wizzard did not copy over the command button nor can i build one one the web page can anyone help me or point me in the right direction. Thanks again
 
For starters, you need to create a thread of your own. No one is likely to notice your question here, as it is posted as a reply to another topic. Secondly, you will want to view the list of forums on the startup page here, and pick one that is appropriate to your needs (for instance, this forum is for MS Access Forms, not web forms like ASP). Good luck, and welcome!

[cheers]

Ever notice how fast Windows runs? Me neither.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top