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

setting color from a function

Status
Not open for further replies.

weeze2

Technical User
Jun 18, 2002
129
DK
How can one set the background color of textboxes from a funktion under modules. fex.

The function whatever returns a string value to some textboxes on a form. their value depends on the day of the week.
Can I also set the backround of the textbox if for example the Weekday()=1

function whatever()
{

If Weekday(Inputdate) = 1 Then
whatever = "sunday"
*******************************************
can I here change the background
*******************************************
Else
whatever = "notsunday"
End If

can someone help??
 
Try this:

txtYourTextBox.BackColor = 12345788

Do determine what the number is for a specific color, set the background color of the text box (in design view) to what you want it to be and look at the BackColor property of the text. Enter that value in place of 12345788, above.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top