X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> How Do I Access Table Visualizations Options In Vba?, Access 2016    
post Aug 27 2019, 08:24 AM

Posts: 85
Joined: 18-January 16

These days I prefer to work with dark themes so I'm implementing them everywhere. Reversing colors for the forms and their controls was easy with a sub, but tables still display a fully white datasheet. The toolbar does have some buttons for text formating including the colors, but changes are only saved for the table where they were implemented, so I would have to do that manually for each table on the database. Is there a way to do that with VBA? In which object is this information located? I guess it is the same one that saves options like column order and widths, but DAO.Tabledef doesn't seem to be the object to acess this information.
Go to the top of the page
Start new topic
post Aug 27 2019, 11:35 AM

UtterAccess Moderator
Posts: 11,906
Joined: 6-December 03
From: Telegraph Hill

Hi, you can do this if you use a datasheet form, but I don't think it works is you use the table directly:
Function fDatasheetDefaults( _
  frm As Form, _
  Optional CellsEffect As Integer = acEffectNormal, _
  Optional GridlinesBehavior As Integer = acGridlinesVert, _
  Optional GridlinesColor As Long = 7500402, _
  Optional BackColor As Long = 4144959, _
  Optional AlternateBackColor As Long = 5330263, _
  Optional FontName As String = "Segoe UI", _
  Optional ForeColor As Long = vbWhite, _
  Optional FontHeight As Integer = 10 _
) As Boolean

  With frm
    .DatasheetCellsEffect = CellsEffect
    .DatasheetGridlinesBehavior = GridlinesBehavior
    .DatasheetGridlinesColor = GridlinesColor
    .DatasheetBackColor = BackColor
    .DatasheetAlternateBackColor = AlternateBackColor
    .DatasheetFontName = FontName
    .DatasheetForeColor = ForeColor
    .DatasheetFontHeight = FontHeight
  End With
  fDatasheetDefaults = (Err = 0)

End Function

Then in Form_Load():
  Call fDatasheetDefaults(Me)





David Marten
Go to the top of the page

Posts in this topic

Custom Search

RSSSearch   Top   Lo-Fi    10th December 2019 - 09:29 PM