Background color of data fields according to content

P

Patrick Merz

I'm new to this, so if it's a trivial question, please forgive me...

In a Form:

To better show the user which fields of the form are still empty, I would
like those fields to have a (let's say) yellow background color.
Fields who have already been filled in should have a grey background.

How do I do this?

Thanks!!
 
S

Steve Schapel

Patrick,

You could use Conditional Formatting, which I think you would need to
set up via the Format menu for each textbox on the form. Use the
expression like this... [NameOfYourTextbox] Is Not Null and then set the
colour to grey, etc.
 
P

Patrick Merz

I was thinking of that too (like in Excel) ... but I don't see a
"Conditional Formatting" option in
my menu ...

???

So I could not use that.



Steve Schapel said:
Patrick,

You could use Conditional Formatting, which I think you would need to set
up via the Format menu for each textbox on the form. Use the expression
like this... [NameOfYourTextbox] Is Not Null and then set the colour to
grey, etc.

--
Steve Schapel, Microsoft Access MVP


Patrick said:
I'm new to this, so if it's a trivial question, please forgive me...

In a Form:

To better show the user which fields of the form are still empty, I would
like those fields to have a (let's say) yellow background color.
Fields who have already been filled in should have a grey background.

How do I do this?

Thanks!!
 
J

JohnFol

If you have the form in design view, right click the textbox and you will
see the ConditionalFormating details

Patrick Merz said:
I was thinking of that too (like in Excel) ... but I don't see a
"Conditional Formatting" option in
my menu ...

???

So I could not use that.



Steve Schapel said:
Patrick,

You could use Conditional Formatting, which I think you would need to set
up via the Format menu for each textbox on the form. Use the expression
like this... [NameOfYourTextbox] Is Not Null and then set the colour to
grey, etc.

--
Steve Schapel, Microsoft Access MVP


Patrick said:
I'm new to this, so if it's a trivial question, please forgive me...

In a Form:

To better show the user which fields of the form are still empty, I
would like those fields to have a (let's say) yellow background color.
Fields who have already been filled in should have a grey background.

How do I do this?

Thanks!!
 
P

Patrick Merz

I don't ... apparently, as I'm using Access 97, that feature is not
available in that version ...

any other workarounds?



JohnFol said:
If you have the form in design view, right click the textbox and you will
see the ConditionalFormating details

Patrick Merz said:
I was thinking of that too (like in Excel) ... but I don't see a
"Conditional Formatting" option in
my menu ...

???

So I could not use that.



Steve Schapel said:
Patrick,

You could use Conditional Formatting, which I think you would need to
set up via the Format menu for each textbox on the form. Use the
expression like this... [NameOfYourTextbox] Is Not Null and then set the
colour to grey, etc.

--
Steve Schapel, Microsoft Access MVP


Patrick Merz wrote:
I'm new to this, so if it's a trivial question, please forgive me...

In a Form:

To better show the user which fields of the form are still empty, I
would like those fields to have a (let's say) yellow background color.
Fields who have already been filled in should have a grey background.

How do I do this?

Thanks!!
 
J

JohnFol

I can only suggest having a look in the help screens for "Format"


Patrick Merz said:
I don't ... apparently, as I'm using Access 97, that feature is not
available in that version ...

any other workarounds?



JohnFol said:
If you have the form in design view, right click the textbox and you will
see the ConditionalFormating details

Patrick Merz said:
I was thinking of that too (like in Excel) ... but I don't see a
"Conditional Formatting" option in
my menu ...

???

So I could not use that.



Patrick,

You could use Conditional Formatting, which I think you would need to
set up via the Format menu for each textbox on the form. Use the
expression like this... [NameOfYourTextbox] Is Not Null and then set
the colour to grey, etc.

--
Steve Schapel, Microsoft Access MVP


Patrick Merz wrote:
I'm new to this, so if it's a trivial question, please forgive me...

In a Form:

To better show the user which fields of the form are still empty, I
would like those fields to have a (let's say) yellow background color.
Fields who have already been filled in should have a grey background.

How do I do this?

Thanks!!
 
S

Steve Schapel

Patrick,

Is your form a Single view or Continuous view? If Single, you can use a
VBA procedures to manipulate the colour of your controls. You would
need to put code on the Current event of the form itself, and on the
After Update event of each affected control. For example...
Private Sub MyTextbox_AfterUpdate()
If IsNull(Me.MyTextbox) Then
Me.MyTextbox.BackColor = vbYellow
Else
Me.MyTextbox.BackColor = -2147483640
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top