UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> How Do I Access Table Visualizations Options In Vba?, Access 2016    
 
   
javert
post Aug 27 2019, 08:24 AM
Post#1



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
 
cheekybuddha
post Aug 27 2019, 11:35 AM
Post#2


UtterAccess VIP
Posts: 11,696
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:
CODE
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():
CODE
  Call fDatasheetDefaults(Me)


hth,

d

--------------------


Regards,

David Marten
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    19th November 2019 - 01:51 PM