473,386 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Changing Form back color in Datasheet view - Access 2007

I have some Forms that were created from Queries and are presented in Datasheet view. I can change the back colour in design mode but when I save changes and open the Forms they revert to the old grey color again. Is there some VBA code I can use to set the colour every time a form is opened? I've had no success so far.
Jan 27 '13 #1

✓ answered by zmbd

V2010:
Open the form in datasheet view.
You should see a context Ribbon with main tab title "FORM TOOLS" sub heading "Datasheet"
Formatting subgroup.
You can set the background colour and the alternate row colour within this ribbon.
Setting these from the properties sheet appears to just effect the single/continuous form views.

Also via vba:
give the form a module
(just something with an event - even the onload just something)
Then using the intlisense:
me.datasheet____________ will give you a list of the datasheet background etc. You can select one of these and then [F1] for more information as some of these were added starting with V2007.

For the v2003: DatasheetBackColor Property [Access 2003 VBA Language Reference] you can look at the others within the list to the left.

I'm sure there's something along the same lines for V2007/2010; however, I don't have time to hunt it down today.

13 17410
NeoPa
32,556 Expert Mod 16PB
The colour for Datasheet View is not relative to individual forms. Datasheet View, and its configuration, is a property of Access itself, and you will find configuring it can be done using Tools | Options and selecting the Datasheet tab.
Jan 28 '13 #2
Seth Schrock
2,965 Expert 2GB
I believe that in Access 2007, this would be found in File (the Office logo) > Access Options. In Access 2010 however, there isn't an option for the background color in the Datasheet tab. Not sure if Access 2007 has it there or not.
Jan 28 '13 #3
Thanks guys. This database has quite a few Forms. Some are converted from Queries primarily to make them programmable, but also to be able to make them intuitively recognisable (or so I thought). I wondered if this might be achievable using the BackColor property in VBA on Form loading, but your replies imply not. Thanks anyway.
Jan 28 '13 #4
TheSmileyCoder
2,322 Expert Mod 2GB
Another option if it is only the backcolour of the fields you want to have coloured is to use conditional formatting. Its not something I am too fond of as it often appears to be a bit "laggy" in updating, but it might be something to consider.
Jan 28 '13 #5
zmbd
5,501 Expert Mod 4TB
V2010:
Open the form in datasheet view.
You should see a context Ribbon with main tab title "FORM TOOLS" sub heading "Datasheet"
Formatting subgroup.
You can set the background colour and the alternate row colour within this ribbon.
Setting these from the properties sheet appears to just effect the single/continuous form views.

Also via vba:
give the form a module
(just something with an event - even the onload just something)
Then using the intlisense:
me.datasheet____________ will give you a list of the datasheet background etc. You can select one of these and then [F1] for more information as some of these were added starting with V2007.

For the v2003: DatasheetBackColor Property [Access 2003 VBA Language Reference] you can look at the others within the list to the left.

I'm sure there's something along the same lines for V2007/2010; however, I don't have time to hunt it down today.
Jan 28 '13 #6
Thanks. Your VBA solution typing in "me.datasheet.BackColor = RGB(X,Y,Z)" on opening the form worked fine!
Jan 29 '13 #7
NeoPa
32,556 Expert Mod 16PB
If that works for you in Access 2007 then it must have been introduced in that version. I know it isn't available in 2003.
Jan 30 '13 #8
zmbd
5,501 Expert Mod 4TB
Neopa:

Directly from the link given for 2003:
The following table contains the properties that don't exist in the DAO Properties collection of until you set them by using the Formatting (Datasheet) toolbar or you can add them in an Access database (.mdb) by using the CreateProperty method and append it to the DAO Properties collection.
Jan 30 '13 #9
TheSmileyCoder
2,322 Expert Mod 2GB
Wow, talk about a deeply buried feature.
Jan 30 '13 #10
NeoPa
32,556 Expert Mod 16PB
Indeed Smiley. That about sums it up.

Z. That's fantastic to know. Adding the property is not a problem. I just never knew it even could be until your comment.
Jan 30 '13 #11
zmbd
5,501 Expert Mod 4TB
Ran across it quite by accident.
One of the commercial applications we were using could do this... so trying to duplicate it... thinking that the COM add-in had it buried, well, leave it to a chemist to break something apart (giggle).
Jan 30 '13 #12
TheSmileyCoder
2,322 Expert Mod 2GB
/me runs off to google "Access easteregg" and "Access hidden features"
Jan 30 '13 #13
NeoPa
32,556 Expert Mod 16PB
Z:
leave it to a chemist to break something apart (giggle).
I'm continually impressed by the chemists we have contributing on the site :-)
Jan 31 '13 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Kent Eilers | last post by:
I want to follow naming conventions for my controls - i usually prefix combo boxes with "cbo". When a form is in datasheet view however i do not want the user to see the 'cbo' prefix in front of...
2
by: Georges Heinesch | last post by:
Hi: I have a tables in relationship to each other. When I open the main table (table 1), I see a "+" at the very left of every record. Clicking on the "+" expands the data of the linked table...
2
by: sierrachang | last post by:
Why would one not want to sort records in a form using Form Properties > Datasheet View > Sort Ascending? It's the fastest way, isn't it?
3
by: Nilz | last post by:
Hi all, i am using UltraWinGrid in my application and i want to change the Back Color of the Active Cell to transparent. i have defined CellClickAction as RowSelect. So if we click on the cell the...
1
by: gnews | last post by:
I'm learning Access (2002) as I go, but I can't find how to open a form from a datasheet view. I want to be able to view records in the datasheet and click on a link to open a form to allow me...
2
by: guroos | last post by:
If there are no custom toolbars in 2007 runtime how do I enable a user to switch to datasheet view and back?
4
by: dwasbig9 | last post by:
Hi Group, I'm creating a maintenance switchboard and am trying to create forms to update tables and wanted these to appear as datasheets. Although I have the default view set to datasheet and...
1
by: gman | last post by:
Is there a way in VB.NET to build a Form/Control as easily as Access 2007 does? I built a small name and address application in Access 2007 and I was surprised at what I was able to do without any...
1
by: phillikl | last post by:
Good day, First would like to say I use this site to find more trivial stuff than anyplace else.. THANKS!!! Been looking for a few hours on this and seem to be not asking the correct...
0
by: GARZAAX | last post by:
Hello; I am in serious need of help. I have a form with subform that I am developing to fill in multiple data on customer orders. the need has come to duplicate up to 10 times the information on...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.