By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,767 Members | 1,095 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,767 IT Pros & Developers. It's quick & easy.

Continuos form format

P: n/a
Ian
I have a continuos form with a Yes-No field and a text box on it, I am
trying to get the Yes-No box text to turn Red when it set to Yes and Black
when its set to No.

I have tried stuff like:

If [YN] = "yes" Then

[YN].ForeColor = 0

Else

[YN].ForeColor = 1

End If

But I am not sure which event to put this kind of code on, it does not work
on the On Current event.

A friend suggested that this can be done by putting something like:

#[Blue];#[Red]

On the Format of the text box. This does seem to change to Red if set to Yes
but only works with number fields ( like 0 and -1) but I don't want a red 1
to appear, I want it to say the word Yes in the colour of red, and
preferably change the other text box to red at the same time.

Any help would be appreciated.
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies

P: n/a
Ian, I'd put a call to your function in either the On Current event or the
Before Update event.

I made up the following function, for a form with a checkoff field (Check2)
and a text field (Text0):

Public Sub test()
If [Check2] = -1 Then
Me!Text0.ForeColor = 255
Else
Me!Text0.ForeColor = 1
End If
End Sub

It works with my test form. It checks for a Yes (-1) in the Check2 field,
if it is -1, it sets the Text0 font color to red. If not, the color changes
to black.

HTH

Skip

"Ian" <ia********@ntlworld.com> wrote in message
news:_8*****************@newsfep1-win.server.ntli.net...
I have a continuos form with a Yes-No field and a text box on it, I am
trying to get the Yes-No box text to turn Red when it set to Yes and Black
when its set to No.

I have tried stuff like:

If [YN] = "yes" Then

[YN].ForeColor = 0

Else

[YN].ForeColor = 1

End If

But I am not sure which event to put this kind of code on, it does not work on the On Current event.

A friend suggested that this can be done by putting something like:

#[Blue];#[Red]

On the Format of the text box. This does seem to change to Red if set to Yes but only works with number fields ( like 0 and -1) but I don't want a red 1 to appear, I want it to say the word Yes in the colour of red, and
preferably change the other text box to red at the same time.

Any help would be appreciated.

Nov 12 '05 #2

P: n/a
Try something like

; "Yes"[Blue]; "No"[Red]

(semicolon at beginning) on the format property

hth
Roberto
"Ian" <ia********@ntlworld.com> escreveu na mensagem
news:_8*****************@newsfep1-win.server.ntli.net...
I have a continuos form with a Yes-No field and a text box on it, I am
trying to get the Yes-No box text to turn Red when it set to Yes and Black
when its set to No.

I have tried stuff like:

If [YN] = "yes" Then

[YN].ForeColor = 0

Else

[YN].ForeColor = 1

End If

But I am not sure which event to put this kind of code on, it does not work on the On Current event.

A friend suggested that this can be done by putting something like:

#[Blue];#[Red]

On the Format of the text box. This does seem to change to Red if set to Yes but only works with number fields ( like 0 and -1) but I don't want a red 1 to appear, I want it to say the word Yes in the colour of red, and
preferably change the other text box to red at the same time.

Any help would be appreciated.

Nov 12 '05 #3

P: n/a
Ian
Many Thanks
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.