Finally a Fix for the Images not showing in Forms and Report for Access 2016

It took several months, but Microsoft finally has released an official fix for the issue of images not showing on forms and reports in MS Access 2016.

Microsoft Installer (.msi)-based edition of Office 2016

It can be downloaded from Microsoft’s site at:

https://support.microsoft.com/en-us/kb/3114379

Office 2016 Click-to-Run editions

It took a few extra days, but the fix has finally been ported to the Click-to-Run editions as well.

File -> Account -> Office Updates -> Update Now

I haven’t taken the time to test out either yet, but should it ever fail, you can always try one of the original workarounds proposed in: http://www.devhut.net/ms-access-missing-images-images-not-showing/, but hopefully this will be the end of this dreaded issue.

 

MS Access – Missing Images, Images not showing

UPDATE

There’s finally an official update from Microsoft to fix the problem, see: http://www.devhut.net/2015/12/08/finally-a-fix-for-the-images-not-showing-in-forms-and-report-for-access-2016/ for all the details and links.


There has been a MAJOR screw up and sadly we are seeing countless posts/questions regarding images not showing up in forms/reports.  Sadly, even several months after being flagged, we are still waiting upon an official fix from Microsoft!  🙁

Proposed Solution 1

One proposed solution is to set your database options (File -> Options -> Current Database)

12-5-2015 6-57-31 AM

and then reinsert all your images, but this will still not help if you are working with bmp images, so you’d need to ensure they are of another image format first.

Proposed Solution 2

Another fix has been to simply change the image’s Size Mode to Stretch or Clip and changing the Picture Type to Linked.  In many cases, it was as simple as that.

12-5-2015 7-03-34 AM

Below is the beginning of code to loop through all the forms and reports within a database and switch the properties in question.  The issue being that one way or another, you will still need to manually intervene since by switching them from Embedded to Linked, you will need to supply a path/filename.

'---------------------------------------------------------------------------------------
' Procedure : FixImages
' Author    : Daniel Pineault, CARDA Consultants Inc.
' Website   : http://www.cardaconsultants.com
' Purpose   : Try to start fixing MS' mess with images
' Copyright : The following may be altered and reused as you wish so long as the
'             copyright notice is left unchanged (including Author, Website and
'             Copyright).  It may not be sold/resold or reposted on other sites (links
'             back to this site are allowed).
'
' Revision History:
' Rev       Date(yyyy/mm/dd)        Description
' **************************************************************************************
' 1         2015-11-30              Initial Release
'---------------------------------------------------------------------------------------
Sub FixImages()
    On Error GoTo Error_Handler
    Dim DbO                   As AccessObject
    Dim DbP                   As Object
    Dim frm                   As Access.Form
    Dim rpt                   As Access.Report
    Dim ctl                   As Access.Control

    Set DbP = Application.CurrentProject

    'Review/Fix Forms
    Debug.Print "Processing Forms"
    Debug.Print "~~~~~~~~~~~~~~~~"
    For Each DbO In DbP.AllForms
        Debug.Print vbTab & DbO.Name
        DoCmd.OpenForm DbO.Name, acDesign    'Open the form in design view so we can work with it
        Set frm = Forms(DbO.Name)
        With frm
            For Each ctl In .Controls    'Loop through all of the controls
                If ctl.ControlType = acImage Then    'If an image control is found then apply our settings
                    Debug.Print vbTab & vbTab & ctl.Name
                    ctl.SizeMode = acOLESizeClip    'could also be acOLESizeStretch - https://msdn.microsoft.com/en-us/library/office/ff837281(v=office.15).aspx
                    ctl.PictureType = 1    '0 would be embedded - https://msdn.microsoft.com/en-us/library/office/ff197027(v=office.15).aspx
                End If
            Next
        End With
        DoCmd.Close acForm, DbO.Name, acSaveYes    'Close and save our changes
    Next DbO

    'Review/Fix Reports
    Debug.Print "Processing Reports"
    Debug.Print "~~~~~~~~~~~~~~~~"
    For Each DbO In DbP.AllReports
        Debug.Print vbTab & DbO.Name
        DoCmd.OpenReport DbO.Name, acDesign    'Open the report in design view so we can work with it
        Set rpt = Reports(DbO.Name)
        With rpt
            For Each ctl In .Controls    'Loop through all of the controls
                If ctl.ControlType = acImage Then    'If an image control is found then apply our settings
                    Debug.Print vbTab & vbTab & ctl.Name
                    ctl.SizeMode = acOLESizeClip    'could also be acOLESizeStretch - https://msdn.microsoft.com/en-us/library/office/ff837281(v=office.15).aspx
                    ctl.PictureType = 1    '0 would be embedded - https://msdn.microsoft.com/en-us/library/office/ff197027(v=office.15).aspx
                End If
            Next
        End With
        DoCmd.Close acReport, DbO.Name, acSaveYes    'Close and save our changes
    Next DbO
    
    Debug.Print "Operation Complete!"

Error_Handler_Exit:
    On Error Resume Next
    Set ctl = Nothing
    Set frm = Nothing
    Set rpt = Nothing
    Set DbO = Nothing
    Set DbP = Nothing
    Exit Sub

Error_Handler:
    MsgBox "The following error has occurred." & vbCrLf & vbCrLf & _
           "Error Number: " & Err.Number & vbCrLf & _
           "Error Source: FixImages" & vbCrLf & _
           "Error Description: " & Err.Description, _
           vbCritical, "An Error has Occurred!"
    Resume Error_Handler_Exit
End Sub

What might also be useful is a simple procedure to quickly identify the problematic forms and reports. Below is such a procedure, it will loop through all the forms and reports looking for the specified control type; in our case acImage.

'---------------------------------------------------------------------------------------
' Procedure : IdentifyImageObjects
' Author    : Daniel Pineault, CARDA Consultants Inc.
' Website   : http://www.cardaconsultants.com
' Purpose   : Identify Forms/Reports with the specified control type
' Copyright : The following may be altered and reused as you wish so long as the
'             copyright notice is left unchanged (including Author, Website and
'             Copyright).  It may not be sold/resold or reposted on other sites (links
'             back to this site are allowed).
'
' Usage     : Call IdentifyImageObjects(acImage)
'           : Call IdentifyImageObjects(acLabel)
'
' Revision History:
' Rev       Date(yyyy/mm/dd)        Description
' **************************************************************************************
' 1         2015-11-30              Initial Release
'---------------------------------------------------------------------------------------
Sub IdentifyImageObjects(sCtlType As AcControlType, Optional bLeaveOpen As Boolean = True)
    On Error GoTo Error_Handler
    Dim DbO                   As AccessObject
    Dim DbP                   As Object
    Dim frm                   As Access.Form
    Dim rpt                   As Access.Report
    Dim ctl                   As Access.Control
    Dim bCtlTypeFound         As Boolean

    Set DbP = Application.CurrentProject

    'Review/Fix Forms
    Debug.Print "Processing Forms"
    Debug.Print "~~~~~~~~~~~~~~~~"
    For Each DbO In DbP.AllForms
        bCtlTypeFound = False
        DoCmd.OpenForm DbO.Name, acDesign    'Open the form in design view so we can work with it
        Set frm = Forms(DbO.Name)
        With frm
            For Each ctl In .Controls    'Loop through all of the controls
                If ctl.ControlType = sCtlType Then    'If an image control is found then apply our settings
                    bCtlTypeFound = True
                    Exit For    'Stop the loop once we find 1 instance of the Control Type we are searching for
                End If
            Next
        End With
        If bCtlTypeFound = True Then
            Debug.Print vbTab & DbO.Name
            If bLeaveOpen = False Then DoCmd.Close acForm, DbO.Name, acSaveNo
        Else
            DoCmd.Close acForm, DbO.Name, acSaveNo
        End If
    Next DbO

    'Review/Fix Reports
    Debug.Print "Processing Reports"
    Debug.Print "~~~~~~~~~~~~~~~~"
    For Each DbO In DbP.AllReports
        bCtlTypeFound = False
        DoCmd.OpenReport DbO.Name, acDesign    'Open the report in design view so we can work with it
        Set rpt = Reports(DbO.Name)
        With rpt
            For Each ctl In .Controls    'Loop through all of the controls
                If ctl.ControlType = sCtlType Then    'If an image control is found then apply our settings
                    bCtlTypeFound = True
                    Exit For    'Stop the loop once we find 1 instance of the Control Type we are searching for
                End If
            Next
        End With
        If bCtlTypeFound = True Then
            Debug.Print vbTab & DbO.Name
            If bLeaveOpen = False Then DoCmd.Close acReport, DbO.Name, acSaveNo
        Else
            DoCmd.Close acReport, DbO.Name, acSaveNo
        End If
    Next DbO

    Debug.Print "Operation Complete!"

Error_Handler_Exit:
    On Error Resume Next
    Set ctl = Nothing
    Set frm = Nothing
    Set rpt = Nothing
    Set DbO = Nothing
    Set DbP = Nothing
    Exit Sub

Error_Handler:
    MsgBox "The following error has occurred." & vbCrLf & vbCrLf & _
           "Error Number: " & Err.Number & vbCrLf & _
           "Error Source: IdentifyImageObjects" & vbCrLf & _
           "Error Description: " & Err.Description, _
           vbCritical, "An Error has Occurred!"
    Resume Error_Handler_Exit
End Sub

Proposed Solution 3

I also found an interesting statement (taken from: http://answers.microsoft.com/en-us/office/forum/office_365hp-access/embedded-images-disappeared-after-upgrade-to/2c84727f-89e8-48f8-9096-eb330379d4c6?page=1) in which user sLaeYa says:

If you export your Form:

  • Right Click on the Form in Navigation Pane
  • Select Export to XML File
  • Choose Destination
  • Select Data and Presentation

In the destination folder there is an images folder, you will find that the names of your main embedded image has changed to “Form_Name.BMP”

If you change the file name to the new one it starts working again.

I cannot confirm or deny this claim as I haven’t had the time to test it out yet.  Feel free to leave a comment should you have any more relevant information on the subject.

MS Access Genealogy Database

I have seen numerous questions in forums over the years about Genealogy Databases.  At one point in time, Microsoft had a primitive database template, only available through the British site (scratching my head as to why), but when they move forward to Access 2010 or 2013, the links I had stopped working and you couldn’t locate it through the Office Template search (heck Access doesn’t even show up in the list anymore! – another brilliant improvement brought to you by the people at Microsoft!)

Recently, the question came up again and Jeff Conrad was kind enough to supply us with a direct link:

Continue reading

VBA – Enumerate Fonts

Just a little twist on my code from my last post (VBA – Is a Font Installed). Should you need a listing of available fonts, why not employ so simple word automation to extract a list.

'---------------------------------------------------------------------------------------
' Procedure : EnumerateFonts
' Author    : Daniel Pineault, CARDA Consultants Inc.
' Website   : http://www.cardaconsultants.com
' Purpose   : List the available fonts on the system
' Copyright : The following may be altered and reused as you wish so long as the
'             copyright notice is left unchanged (including Author, Website and
'             Copyright).  It may not be sold/resold or reposted on other sites (links
'             back to this site are allowed).
'
' Usage:
' ~~~~~~
' Call EnumerateFonts
'
' Revision History:
' Rev       Date(yyyy/mm/dd)        Description
' **************************************************************************************
' 1         2015-10-15              Initial Release
'---------------------------------------------------------------------------------------
Public Function EnumerateFonts()
    On Error GoTo Error_Handler
    Dim oWord                 As Object
    Dim i                     As Long

    Set oWord = CreateObject("Word.Application")
    For i = 1 To oWord.FontNames.Count
        Debug.Print oWord.FontNames(i)
    Next i

Error_Handler_Exit:
    On Error Resume Next
    oWord.Quit
    Set oWord = Nothing
    Exit Function

Error_Handler:
    MsgBox "The following error has occurred." & vbCrLf & vbCrLf & _
           "Error Number: " & Err.Number & vbCrLf & _
           "Error Source: EnumerateFonts" & vbCrLf & _
           "Error Description: " & Err.Description, _
           vbCritical, "An Error has Occurred!"
    Resume Error_Handler_Exit
End Function

VBA – Is a Font Installed

I recently had an issue believed to be linked to the fact that the font I was using (a very common font) might not be installed on a specific server. I thought it would be very easy to validate this by adding a simple function in VBA, but as it turns out, this seems to be quite a challenge.

Below was my solution. Since I know that the computers in question all had MS Office installed, and thus Word will be present, I utilized Word automation.

'---------------------------------------------------------------------------------------
' Procedure : IsFontInstalled
' Author    : Daniel Pineault, CARDA Consultants Inc.
' Website   : http://www.cardaconsultants.com
' Purpose   : Verify is the specified font is installed or not
' Copyright : The following may be altered and reused as you wish so long as the
'             copyright notice is left unchanged (including Author, Website and
'             Copyright).  It may not be sold/resold or reposted on other sites (links
'             back to this site are allowed).
'
' Input Variables:
' ~~~~~~~~~~~~~~~~
' sFontName : Name of the Font to search for
'
' Usage:
' ~~~~~~
' IsFontInstalled("Arial")
'
' Revision History:
' Rev       Date(yyyy/mm/dd)        Description
' **************************************************************************************
' 1         2015-10-15              Initial Release
'---------------------------------------------------------------------------------------
Public Function IsFontInstalled(sFontName As String) As Boolean
    On Error GoTo Error_Handler
    Dim oWord                 As Object
    Dim i                     As Long

    Set oWord = CreateObject("Word.Application")
    For i = 1 To oWord.FontNames.Count
        If LCase(oWord.FontNames(i)) = LCase(sFontName) Then
            IsFontInstalled = True
            Exit For
        End If
    Next I

Error_Handler_Exit:
    On Error Resume Next
    oWord.Quit
    Set oWord = Nothing
    Exit Function

Error_Handler:
    MsgBox "The following error has occurred." & vbCrLf & vbCrLf & _
           "Error Number: " & Err.Number & vbCrLf & _
           "Error Source: IsFontInstalled" & vbCrLf & _
           "Error Description: " & Err.Description, _
           vbCritical, "An Error has Occurred!"
    Resume Error_Handler_Exit
End Function

If you want an alternative approach, one that doesn’t require Word being installed, then be sure to check out:

MS Access – VBA – Determine the Number of Fields in a Table

Sometimes it can be useful to quickly evaluate the databases tables structures.  One aspect that can tell an experienced developer a whole lot is the number of fields in a table.  Unlike Excel, a properly normalized database is one that does not have tables with large numbers of fields.  I personally start to question database design when I start seeing tables with 20+ fields in them.  That isn’t to say they’re aren’t legitimate instances for tables with more fields, but in general terms this is a good indicator that there could be basic data normalization problems.

As such, I created 2 (just to illustrate that is more than one way to get the information) simple functions to get this information.

'---------------------------------------------------------------------------------------
' Procedure : GetTblFldCount
' Author    : Daniel Pineault, CARDA Consultants Inc.
' Website   : http://www.cardaconsultants.com
' Purpose   : Determine the number of fields in the specified table
' Copyright : The following may be altered and reused as you wish so long as the
'             copyright notice is left unchanged (including Author, Website and
'             Copyright).  It may not be sold/resold or reposted on other sites (links
'             back to this site are allowed).
'
' Input Variables:
' ~~~~~~~~~~~~~~~~
' sTblName  : Name of the table you which to get the field count of
'
' Usage:
' ~~~~~~
' GetTblFldCount("Contact")
'
' Revision History:
' Rev       Date(yyyy/mm/dd)        Description
' **************************************************************************************
' 1         2011-02-07              Initial Release
'---------------------------------------------------------------------------------------
Function GetTblFldCount(sTblName As String)
    On Error GoTo Error_Handler

    GetTblFldCount = CurrentDb.TableDefs(sTblName).Fields.Count

Error_Handler_Exit:
    On Error Resume Next
    Exit Function

Error_Handler:
    If Err.Number = 3265 Then
        MsgBox "The following error has occurred." & vbCrLf & vbCrLf & _
               "Error Number: 3265" & vbCrLf & _
               "Error Source: GetTblFldCount" & vbCrLf & _
               "Error Description: The table '" & sTblName & "' could not be found in the current database.", _
               vbCritical, "An Error has Occurred!"
    Else
        MsgBox "The following error has occurred." & vbCrLf & vbCrLf & _
               "Error Number: " & Err.Number & vbCrLf & _
               "Error Source: GetTblFldCount" & vbCrLf & _
               "Error Description: " & Err.Description, _
               vbCritical, "An Error has Occurred!"
    End If
    Resume Error_Handler_Exit
End Function
'---------------------------------------------------------------------------------------
' Procedure : GetTblFldCount2
' Author    : Daniel Pineault, CARDA Consultants Inc.
' Website   : http://www.cardaconsultants.com
' Purpose   : Determine the number of fields in the specified table
' Copyright : The following may be altered and reused as you wish so long as the
'             copyright notice is left unchanged (including Author, Website and
'             Copyright).  It may not be sold/resold or reposted on other sites (links
'             back to this site are allowed).
'
' Input Variables:
' ~~~~~~~~~~~~~~~~
' sTblName  : Name of the table you which to get the field count of
'
' Usage:
' ~~~~~~
' GetTblFldCount("Contact")
'
' Revision History:
' Rev       Date(yyyy/mm/dd)        Description
' **************************************************************************************
' 1         2011-02-07              Initial Release
'---------------------------------------------------------------------------------------
Function GetTblFldCount2(sTblName As String)
    On Error GoTo Error_Handler
    Dim rs As DAO.Recordset
    
    Set rs = CurrentDb.OpenRecordset("SELECT * FROM [" & sTblName & "] WHERE (FALSE);")
    GetTblFldCount2 = rs.Fields.Count

Error_Handler_Exit:
    On Error Resume Next
    rs.Close
    Set rs = Nothing
    Exit Function

Error_Handler:
    If Err.Number = 3265 Then
        MsgBox "The following error has occurred." & vbCrLf & vbCrLf & _
               "Error Number: 3265" & vbCrLf & _
               "Error Source: GetTblFldCount2" & vbCrLf & _
               "Error Description: The table '" & sTblName & "' could not be found in the current database.", _
               vbCritical, "An Error has Occurred!"
    Else
        MsgBox "The following error has occurred." & vbCrLf & vbCrLf & _
               "Error Number: " & Err.Number & vbCrLf & _
               "Error Source: GetTblFldCount2" & vbCrLf & _
               "Error Description: " & Err.Description, _
               vbCritical, "An Error has Occurred!"
    End If
    Resume Error_Handler_Exit
End Function

and then to simplify the process of manually inputting each table name one by one, we could create a simple procedure to quick check every table within the current database, and it would look something like:

Public Sub CheckNoTblFlds()
    On Error GoTo Error_Handler
    Dim db As DAO.Database
    Dim sTblName As String
 
    Set db = CurrentDb()
    For i = 0 To db.TableDefs().Count - 1
        sTblName = db.TableDefs(i).Name
        If Not (sTblName Like "MSys*") And Not (sTblName Like "~*") Then 'Let ignore system tables
            Debug.Print sTblName & vbTab & GetTblFldCount(sTblName)
            'Debug.Print sTblName & vbTab & GetTblFldCount2(sTblName)
        End If
    Next i
    
Error_Handler_Exit:
    On Error Resume Next
    Set db = Nothing
    Exit Sub

Error_Handler:
    MsgBox "The following error has occurred." & vbCrLf & vbCrLf & _
           "Error Number: " & Err.Number & vbCrLf & _
           "Error Source: CheckNoTblFlds" & vbCrLf & _
           "Error Description: " & Err.Description, _
           vbCritical, "An Error has Occurred!"
    Resume Error_Handler_Exit
End Sub

So now, by entering one command into the immediate window I can get a report on every single (non-system) table in the database.

MZ-Tools 8.0 Has Been Released!

There are 2 tool/add-ins I install on any computer I will be doing MS Office VBA programming on: (i) Smart Indenter (ii) MZ-Tools.

I’m happy to announce that Carlos Quintero, the man behind MZ-Tools, has released a brand new version of MZ-Tools 8.0.  If you have never heard of MZ-Tools, I would urge you to take a look.  It will seriously aid you in the development process by putting powerful features (much more powerful Search/Find/Replace,  code library, Error Exception and so much more!) at your fingertips.

For an overview of some of the features  of MZ-Tools, check out http://www.mztools.com/v8/features.aspx or better yet, take it for a 30 day test drive.

On a side note, Carlos is giving a 50% reduction on the price of MZ-Tools for a short period of time to celebrate MZ-Tools 15th anniversary.  So if ever you were considering it, now’s the time.

I should also state that I have no affiliation with Carlos or this product.  This is simply my opinion.  I personally believe this to be an exceptional tool and have been using it for years now and couldn’t work without it!

Upgrading from a Prior Version

A nice thing to know is that, if you already have a prior version of MZ-Tools installed, you can install this new version without needing to uninstall your current version.  This permits you to keep the toolbar from the previous version, allowing you some time to get familiar with the new version’s toolbar and features.

Furthermore, I was pleased to see the installation routine asked to import my settings from my prior version, thus saving me the time of setting up my preferences (error handler, procedure header, module header, code library, …).

MS Office – Switch to Local Help

I was recently asked, in a forum, how we could stop using MS Office’s Online Help and start using the Local help file instead, but apply the setting using an automated technique (VBA, RegKey, …).

Not knowing the answer, but very interested, I set out to figure it out. I started by running SysInternal’s Process Monitor which is a tool that logs everything going on a computer. As such, I manually changed the setting and then went and reviewed Process Monitor’s log filtering to only view Registry changes. It quickly became evident that the Registry Key involved in control whether we access Online or Local help was (for Access 2013):

HKCU\Software\Microsoft\Office\15.0\Common\HelpViewer\UseOnlineContent

and further testing revealed that the values were:

1 -> Local Help
2 -> Online Help (Office.com)

With this information it becomes very easy to automate the change.  Probably the easiest technique would be to simply export the Registry Key and apply it to any computers you need to make the change to, but like everything in life, there are numerous other approaches that could be employed to edit the registry key.

So now the mystery is no more.

MS Access – VBA – Find Tables with a Specific Field Type

Part of the process of trying to optimize client databases always involves analyzing tables to try and find potential problems. For instance, I like to quickly identify tables containing Attachment and Memo fields. Now if you’re dealing with a simple database it may be conceivable to open each table one by one and look over the fields manually, but this isn’t efficient, can lead to human error, and certainly is not an option for large databases. As such I put together a simply procedure to perform the check for me and I thought I’d share with the community at large.

'---------------------------------------------------------------------------------------
' Procedure : FindTblWFieldsType
' Author    : Daniel Pineault, CARDA Consultants Inc.
' Website   : http://www.cardaconsultants.com
' Purpose   : Identify which table contains the specified Field Type
' Copyright : The following may be altered and reused as you wish so long as the
'             copyright notice is left unchanged (including Author, Website and
'             Copyright).  It may not be sold/resold or reposted on other sites (links
'             back to this site are allowed).
'
' Usage:
' ~~~~~~
' Call FindTblWFieldsType(dbAttachment)
' Call FindTblWFieldsType(dbMemo)
' Call FindTblWFieldsType(dbBoolean)
'
'
' Revision History:
' Rev       Date(yyyy/mm/dd)        Description
' **************************************************************************************
' 1         2015-Oct-03                 Initial Release
'---------------------------------------------------------------------------------------
Public Sub FindTblWFieldsType(sFieldType As DataTypeEnum)
    On Error GoTo Error_Handler
    Dim db              As DAO.Database
    Dim td              As DAO.TableDefs
    Dim t               As DAO.TableDef
    Dim tdfld           As DAO.TableDef
    Dim fld             As Field

    Set db = CurrentDb()
    Set td = db.TableDefs
    For Each t In td    'loop through all the fields of the tables
        If Left(t.Name, 4) = "MSys" Then 'ignore system tables
            GoTo Continue
        End If
        
        For Each fld In t.Fields    'loop through all the fields of the tables
            If fld.Type = sFieldType Then  'Find attachment fields
                Debug.Print "Processing Table: " & t.Name
                Debug.Print vbTab & "Field: " & fld.Name & " is a(n) " & FieldTypeName(fld) & " field."
                Debug.Print ""
            End If
        Next
        
Continue:
    Next

Error_Handler_Exit:
    On Error Resume Next
    Set tdfld = Nothing
    Set db = Nothing
    Exit Sub

Error_Handler:
    MsgBox "The following error has occurred." & vbCrLf & vbCrLf & _
           "Error Number: " & Err.Number & vbCrLf & _
           "Error Source: FindTblWFieldsType" & vbCrLf & _
           "Error Description: " & Err.Description, _
           vbCritical, "An Error has Occurred!"
    Resume Error_Handler_Exit
End Sub

Function FieldTypeName(fld As DAO.Field) As String
    'Purpose: Converts the numeric results of DAO Field.Type to text.
    'Source/Copyright: Allen Browne
    'URL: http://allenbrowne.com/func-06.html
    Dim strReturn As String    'Name to return

    Select Case CLng(fld.Type) 'fld.Type is Integer, but constants are Long.
        Case dbBoolean: strReturn = "Yes/No"            ' 1
        Case dbByte: strReturn = "Byte"                 ' 2
        Case dbInteger: strReturn = "Integer"           ' 3
        Case dbLong                                     ' 4
            If (fld.Attributes And dbAutoIncrField) = 0& Then
                strReturn = "Long Integer"
            Else
                strReturn = "AutoNumber"
            End If
        Case dbCurrency: strReturn = "Currency"         ' 5
        Case dbSingle: strReturn = "Single"             ' 6
        Case dbDouble: strReturn = "Double"             ' 7
        Case dbDate: strReturn = "Date/Time"            ' 8
        Case dbBinary: strReturn = "Binary"             ' 9 (no interface)
        Case dbText                                     '10
            If (fld.Attributes And dbFixedField) = 0& Then
                strReturn = "Text"
            Else
                strReturn = "Text (fixed width)"        '(no interface)
            End If
        Case dbLongBinary: strReturn = "OLE Object"     '11
        Case dbMemo                                     '12
            If (fld.Attributes And dbHyperlinkField) = 0& Then
                strReturn = "Memo"
            Else
                strReturn = "Hyperlink"
            End If
        Case dbGUID: strReturn = "GUID"                 '15

        'Attached tables only: cannot create these in JET.
        Case dbBigInt: strReturn = "Big Integer"        '16
        Case dbVarBinary: strReturn = "VarBinary"       '17
        Case dbChar: strReturn = "Char"                 '18
        Case dbNumeric: strReturn = "Numeric"           '19
        Case dbDecimal: strReturn = "Decimal"           '20
        Case dbFloat: strReturn = "Float"               '21
        Case dbTime: strReturn = "Time"                 '22
        Case dbTimeStamp: strReturn = "Time Stamp"      '23

        'Constants for complex types don't work prior to Access 2007 and later.
        Case 101&: strReturn = "Attachment"         'dbAttachment
        Case 102&: strReturn = "Complex Byte"       'dbComplexByte
        Case 103&: strReturn = "Complex Integer"    'dbComplexInteger
        Case 104&: strReturn = "Complex Long"       'dbComplexLong
        Case 105&: strReturn = "Complex Single"     'dbComplexSingle
        Case 106&: strReturn = "Complex Double"     'dbComplexDouble
        Case 107&: strReturn = "Complex GUID"       'dbComplexGUID
        Case 108&: strReturn = "Complex Decimal"    'dbComplexDecimal
        Case 109&: strReturn = "Complex Text"       'dbComplexText
        Case Else: strReturn = "Field type " & fld.Type & " unknown"
    End Select

    FieldTypeName = strReturn
End Function

As indicated in the comments of the main procedure, you simply call the sub by:

Call FindTblWFieldsType(dbAttachment)

and it will return (in the VBE immediate window) a result like:

Processing Table: tblTransaction
    Field: Receipt is a(n) Attachment field.
    Field: RefDoc is a(n) Attachment field.

Processing Table: tblTransactionConfirmation
    Field: ConfirmationNotice is a(n) Attachment field.

You might ask what is the point of Allen Browne’s FieldTypeName function. It is used to convert the returned field type (which is numeric) into a comprehensible text. For example, it converts 101 into the word ‘Attachment’ which I use in the reporting. That said since you perform a search for a single field type that you specify, it could be stripped out of my procedure, but I left it to make it as complete and as ‘idiot proof’ as possible to avoid any possible problems.

I hope this help you quickly take control of your database analysis.

Windows 10, Should I Upgrade or Not?

I’ve remained quite quiet on the subject of Windows 10, but over the past month or so I’ve had several clients and family members ask me about my impressions/opinion on the matter, so I thought it was time to finally make a posting.

I was lucky enough to be part of the Microsoft Insider’s program and got to take Windows 10 for a test ride well before its official release.

In comparison to Windows 8, Windows 10 is (in my opinion) far superior.  Then again Windows 8 was a dud, so it isn’t hard to improve upon it. That said, when compared to Windows 7, I truly see nothing of note!  I personally find Microsoft hasn’t innovated on the Windows or Office front in several iterations.  They change layouts, themes, … but not functionalities/features, nothing of note and in the process they keep changing menus, … for no real gain for the average user.

I will limit myself to say that it appears to run very smoothly.

That’s said, recent issues at a client’s office illustrate issues with third-party drivers not being compatible causing MAJOR headaches and performance issues with MS Office, printers and other hardware/software.

The real issue with Windows 10 however has nothing to do with its performance, appearance, … but rather with privacy. In this new version, Microsoft has chosen to follow in the footsteps of most of the other service providers (Google to name but one major player) and has embedded Windows 10 with a number of services/programs that will transmit all sorts of information regarding your usage, software, web surfing, …, in it you give them permission to transfer your personal folders and files. Furthermore, from what I have read, even deactivating all sorts of settings does not in fact terminate the invasion into your privacy.

The other thing that bothers me is the initial EULA you have to accept to use Windows 10 is some 45 pages long! I’m sorry to say but that is simply nuts and unacceptable. It can not be expected of anyone to properly read, little alone understand sufficiently its content to be in a proper position to accept the agreement put forth. No agreement should ever be this convoluted. So people simply agree without ever understanding, little alone being aware of what they are accepting. In this instance however, they are giving Microsoft full permission to pretty much do anything they see fit. Microsoft also does not explain for what purpose the data collection is being done. Perhaps if they elaborated the use, people would not object, but the whole thing is so vague that it allows them to do pretty much anything to choose.

All of this to say, I personally will not be upgrading. If you are not concerned with data harvesting and wish to be an early adopter, do be aware that you may experience so pains until such time as all the necessary drivers are made available.

Lastly, I’ll simply say what many people already know to be true, Nothing in life is Free. So if Microsoft has decided to offer Windows 10 for Free, then they must be getting something in return. They are a corporation and have but one goal in life and that is $$$. I’m not saying don’t upgrade, that is up to you, but do so knowing exactly what you are getting into.

I would have preferred paying for Windows 10 and having a ‘regular’, non-invasive copy, rather than be offered a so called free version which invades one’s privacy in ways no one truly know.

Then again, what do I know anyways, this is just one person’s opinion.  Take the time to read up on the subject, read the EULA and form your own opinion on the matter.

 

The following links maybe be of interest to you and relate directly to this post

http://www.cbc.ca/news/technology/windows-10-1.3223168
http://www.theguardian.com/technology/2015/jul/31/windows-10-microsoft-faces-criticism-over-privacy-default-settings
http://www.techradar.com/news/software/operating-systems/the-windows-10-privacy-settings-you-need-to-change-right-now-1301257
http://pastebin.com/2qhnMk60
https://fix10.isleaked.com/ (appears to be gone!? so try http://web.archive.org/web/20150828023511/https://fix10.isleaked.com/ instead)