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!

Using a command button to populate a bound text box?

Status
Not open for further replies.

ov3rdr1ve

IS-IT--Management
Oct 20, 2004
32
US
I have a command button that when I click it I want it to populate a control on my form with a certain text that is already predetermined...

Is there any way to do this?

Also, I would like to make this text a certain color depending on which text is used.

For instance, I have 3 text options I will populate with...

JUROR ACCEPTED (dark green)
JUROR STRICKEN (dark red)
JUROR POSSIBLE (dark blue)

Is there a way to do this all in one fell swoop or will I have to add it to the OnOpen of the form and create IF statements?

Thanks in advance

Chance~
 
Depending on the version of Access you are using, you might want to investigate Conditional formatting - I'm not sure which version it became available in. I've never used it myself, so I can't show you how.

If that doesn't work, then yes you will need to use either IF statements or a SELECT CASE statement. I would suggest though that you use the OnCurrent event of the form, rather than the OnOpen event. OnOpen is called only once, when the form is opened, whilst OnCurrent is called every time a record is changed - including when a record is first loaded.

Hope this helps.
 
How are ya ov3rdr1ve . . . . .

Whats your criteria for determining which value to use?

[blue]earthandfire[/blue] is correct. Have a look at [purple]Conditional Formatting[/purple].

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top