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:
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