RaymondC
  • RaymondC
  • Advanced Member Topic Starter
2013-06-27T20:27:09Z
I am trying to change the color of the horizontal and vertical gridlines between rows of data.

If GridlineColor is the correct property then it is not working. It has no effect when changed in Access 2010.

Thanks.

Ray

EDIT: The property works if set in the Property Sheet dialog window but not if set via VBA. Not a big deal but F.Y.I.
sam
2013-09-28T04:37:48Z
Grd.GridlineColor = vbRed
Grd.GridLines = igGridLinesBoth

seem to redraw the grid lines.

Thanks.

Sam.

Igor/10Tec
2015-09-07T09:26:35Z
The explanation why it does not work in MS Access is very simple. When we write

Grd.GridlineColor = vbRed

, actually we access a so-called "extender property" provided by MS Access but not the iGrid one (for an explanation of the concept of extender properties, you can read this MSDN article  for VB6).

As we can see from the Object browser, MS Access implements the GridlineColor  property for the Control class:

MS Access Control GridlineColor Property.png

Click to View Image201 View(s)



All controls on MS Access forms can be also referenced through the Control class, and thus they also have its common properties.

To make the iGrid property work, we simply need to access it through the helper Object  sub-property that provides us with direct access to the properties and methods of an ActiveX control:

Grd.Object.GridlineColor = vbRed