Datasheet - cannot change background color of fields

G

Guest

I have a datasheet that is a subform, I can use the conditional format to
change the format based on the value, however I cannot just shade the
background color of the fields. I want to shade the fields that will be
locked to the users. When I am in design view I click on the field and shade
it - it looks like it works, but when I go to form view, the shading is gone.
I have found the only way to shade the fields is to use the conditional
format and put in 2 criteria - if the value is null or not null - then it
works. However, I cannot do this for all the fields since some already have
conditional formats.
Thanks
 
T

tina

add the following procedure to your form's module. the color is light blue,
you can change it to whatever you want, of course.

Private Sub Form_Load()

Me.DatasheetBackColor = 16777164

End Sub

hth
 
J

John W. Vinson

I have a datasheet that is a subform, I can use the conditional format to
change the format based on the value, however I cannot just shade the
background color of the fields. I want to shade the fields that will be
locked to the users. When I am in design view I click on the field and shade
it - it looks like it works, but when I go to form view, the shading is gone.
I have found the only way to shade the fields is to use the conditional
format and put in 2 criteria - if the value is null or not null - then it
works. However, I cannot do this for all the fields since some already have
conditional formats.
Thanks

You've got a lot more flexibility in this regard if you use a Continuous Form
rather than a datasheet. You can set the properties of each control
independently of the others; you still get conditional formatting if you want
it. A Continuous Form can be made to look very much like a datasheet if you
wish.

The one thing you lose is the ability for a user to resize textboxes... but
that's an ability that the user maybe shouldn't have anyway!

John W. Vinson [MVP]
 

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