Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Font with VBA

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
In Excel with VBA it is quit simple to set the font properties. I create a new table and I like to set the Font Type (TAHOMA) and the ForeColor to Blue and the size to 8.
I tried something, code not ok. Is this the way to set the properties.

Code:
Public Sub TABLEFORMAT(tblName As String)

    Dim dbs As DAO.Database
    Dim tdfNew As TableDef
    Dim strTableName As String
    
    Set dbs = DBEngine.Workspaces(0).Databases(0)
    dbs.TableDefs.Refresh
    
    Set tdfNew = dbs.TableDefs(tblName)
    
    SetAccessProperty tdfNew.Properties ..... ?

End Sub
 
Hello

In Access at table level 'format' of text is controlling the texts contents' structure. Meaning how the data is displayed or how currency is listed i.e to what numbe of decimal places.

The display of data is controlled at form/report level in the text boxes etc as this is wher the data interface is delivered, other that tht even in 07 there is no different property to address to ammend the setting

Your only opportunity from 03 onwards is the Rich Text option on a memo field. This will allow you to format the text as you wish.

Sorry couldn't be more help

jo
 
I found it !
Once you know the following keywords, you can search along google and you access the msdn site where a complete sub is at your disposal.

Use
Code:
DatasheetForeColor | DatasheetFontHeight | DatasheetFontName

TIPS : To get the long number of your ForeColor make a temporary textbox choice your color and find the long references in the properties of your textbox.

With DatasheetForeColor you can determine the color of text in a table ! or query or form datasheet.

Its a pitty that I can't reward myself for this excellent tip -:).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top