PC Review


Reply
Thread Tools Rate Thread

Cond Format PHONE #

 
 
=?Utf-8?B?bG12?=
Guest
Posts: n/a
 
      1st Jan 2007
Is there a way to set
(000) 000-0000)
with conditional formatting. I have a phone field I would like the default
to be the above BUT I would like the field to be red to remind the person to
enter the number.

Thanks
 
Reply With Quote
 
 
 
 
=?Utf-8?B?V2F5bmUtSS1N?=
Guest
Posts: n/a
 
      1st Jan 2007
Hi

Yes you can either use conditional formating to do this - click the field
and then Format tab. Select conditional formating and set the "Field Value
is" - "Equall to" then insert "(000) 000-0000)"
Are you sure about the bracketing as it looks wrong ??

Or (to get more options on color) you could use the OnLoad and AfterUpdate
events like this

Private Sub FieldName_AfterUpdate()
Private Sub Form_Load()
"Use one of above"

If Me.FieldName = "(000) 000-0000" Then
Me.FieldName.ForeColor = vbBlack
Me.FieldName.BackColor = vbRed
Else
Me.FieldName.ForeColor = vbBlack
Me.FieldName.BackColor = vbWhite
End If
End Sub

Hope this helps

--
Wayne
Manchester, England.



"lmv" wrote:

> Is there a way to set
> (000) 000-0000)
> with conditional formatting. I have a phone field I would like the default
> to be the above BUT I would like the field to be red to remind the person to
> enter the number.
>
> Thanks

 
Reply With Quote
 
=?Utf-8?B?bG12?=
Guest
Posts: n/a
 
      1st Jan 2007
Thanks I thought I had tried that but like you said extra ) in the format was
the problem. One more question is there a way to set the field to a different
color if it has "no value" as you exit the form if they have missed a field
using what you have below? How do I tell it to look at certain fields? Or
should I post this as a different question? Like how do you set missed
required fields to a diffent color and pop up a msg? <grin>
Thanks!!

"Wayne-I-M" wrote:

> Hi
>
> Yes you can either use conditional formating to do this - click the field
> and then Format tab. Select conditional formating and set the "Field Value
> is" - "Equall to" then insert "(000) 000-0000)"
> Are you sure about the bracketing as it looks wrong ??
>
> Or (to get more options on color) you could use the OnLoad and AfterUpdate
> events like this
>
> Private Sub FieldName_AfterUpdate()
> Private Sub Form_Load()
> "Use one of above"
>
> If Me.FieldName = "(000) 000-0000" Then
> Me.FieldName.ForeColor = vbBlack
> Me.FieldName.BackColor = vbRed
> Else
> Me.FieldName.ForeColor = vbBlack
> Me.FieldName.BackColor = vbWhite
> End If
> End Sub
>
> Hope this helps
>
> --
> Wayne
> Manchester, England.
>
>
>
> "lmv" wrote:
>
> > Is there a way to set
> > (000) 000-0000)
> > with conditional formatting. I have a phone field I would like the default
> > to be the above BUT I would like the field to be red to remind the person to
> > enter the number.
> >
> > Thanks

 
Reply With Quote
 
Steve Schapel
Guest
Posts: n/a
 
      1st Jan 2007
Lmv,

If you are using the Conditional Formatting approach, you can set a
condition using...
'Expression is...' [YourControl] Is Null
.... and set up the colour accordingly.

If you are using the code approach, as suggested by Wayne:

If Me.ControlName = "(000) 000-0000" Then
Me.ControlName.BackColor = vbRed
ElseIf IsNull(Me.ControlName) Then
Me.ControlName.BackColor = vbYellow
Else
Me.ControlName.BackColor = vbWhite
End If

However, I wouldn't expect the Exit event of the form would be correct.
I mean, after you exit the form, you can't see it, so it doesn't
matter what clour it is! Nor would I use the form's Load event as
suggested by Wayne either. I think you would need the code on the
Current event of the form, and also the After Update event of the control.

Myself, I would use Conditional Formatting.

By the way, in this context the meaning is clear, but please note that
forms do not have fields. Fields are in tables and queries, and the
field values are displayed on forms via controls. Probably a good idea
to get in the habit of using 'control' as it can be confusing otherwise
in other contexts. :-)

--
Steve Schapel, Microsoft Access MVP

lmv wrote:
> Thanks I thought I had tried that but like you said extra ) in the format was
> the problem. One more question is there a way to set the field to a different
> color if it has "no value" as you exit the form if they have missed a field
> using what you have below? How do I tell it to look at certain fields? Or
> should I post this as a different question? Like how do you set missed
> required fields to a diffent color and pop up a msg? <grin>
> Thanks!!

 
Reply With Quote
 
=?Utf-8?B?bG12?=
Guest
Posts: n/a
 
      1st Jan 2007
Thanks Steve (and Wayne)

I will work on the "controls" and see what I can accomplish.

but I am sure "I'll BE BACK" (if not this question on another. I SOOOO
apreciate all of the things I have learned on this board. Including accurate
terms so my questions will make sense!!)

Thanks again!

"Steve Schapel" wrote:

> Lmv,
>
> If you are using the Conditional Formatting approach, you can set a
> condition using...
> 'Expression is...' [YourControl] Is Null
> .... and set up the colour accordingly.
>
> If you are using the code approach, as suggested by Wayne:
>
> If Me.ControlName = "(000) 000-0000" Then
> Me.ControlName.BackColor = vbRed
> ElseIf IsNull(Me.ControlName) Then
> Me.ControlName.BackColor = vbYellow
> Else
> Me.ControlName.BackColor = vbWhite
> End If
>
> However, I wouldn't expect the Exit event of the form would be correct.
> I mean, after you exit the form, you can't see it, so it doesn't
> matter what clour it is! Nor would I use the form's Load event as
> suggested by Wayne either. I think you would need the code on the
> Current event of the form, and also the After Update event of the control.
>
> Myself, I would use Conditional Formatting.
>
> By the way, in this context the meaning is clear, but please note that
> forms do not have fields. Fields are in tables and queries, and the
> field values are displayed on forms via controls. Probably a good idea
> to get in the habit of using 'control' as it can be confusing otherwise
> in other contexts. :-)
>
> --
> Steve Schapel, Microsoft Access MVP
>
> lmv wrote:
> > Thanks I thought I had tried that but like you said extra ) in the format was
> > the problem. One more question is there a way to set the field to a different
> > color if it has "no value" as you exit the form if they have missed a field
> > using what you have below? How do I tell it to look at certain fields? Or
> > should I post this as a different question? Like how do you set missed
> > required fields to a diffent color and pop up a msg? <grin>
> > Thanks!!

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cond Format: =?Utf-8?B?ZnJhbmtsaW5idWtvc2tp?= Microsoft Access Forms 2 19th Feb 2007 06:22 PM
Whole Row Cond. Format =?Utf-8?B?UmlwcGVy?= Microsoft Excel Misc 2 6th Oct 2006 08:21 PM
cond format jim brown Microsoft Excel Worksheet Functions 2 20th Apr 2006 01:20 PM
cond format jon Microsoft Excel Misc 4 6th Jul 2004 10:24 AM
Cond format using MIN =?Utf-8?B?R2Vyb24=?= Microsoft Excel Worksheet Functions 3 4th May 2004 02:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:27 AM.