View Full Version : Colour in datasheet view forms


Atomic Shrimp
09-08-2000, 07:43 AM
I have a datasheet form where I want to change the back colour; I can do this by opening it, and using the fill/back colour icon on the toolbar, but I want a colour that's not available from the pop-up palette.

Is it possible to get other colours? - changing the back colour of the fields in desgn view does not affect how it looks in datasheet view, and I can't use a continuous form as I need the user to be able to resize columns.

Any ideas?

Mike

Robert Dunstan
09-08-2000, 08:13 AM
Mike I've just tried doing this in VBA in an Access 2K .mdb.

In the On_Open event of your form try this code:

Me.DatasheetBackColor = RGB(0,0,0)

You can use the RedGreenBlue function to generate any colour by substituting the zeros in the brackets for a number between 0-255. For instance RGB(255,0,0) will generate red, RGB(255,200,20) will generate a horrible yellow colour!

I did this on a subform within a main form and it worked OK

Hope this helps
Rob

Atomic Shrimp
09-11-2000, 06:59 AM
Thanks Robert, that's exactly what I was after.

Mike