Option Compare Database Option Explicit 'This module locks down the current database 'global microsoft access object Private app As Access.Application Public Function tableExists(TBLNAME As String) As Boolean 'returns true if the table exists in the current database else false 'The comparison is case insensitive Dim tdf As TableDef For Each tdf In app.CurrentDb.TableDefs If StrComp(TBLNAME, tdf.name, vbTextCompare) = 0 Then tableExists = True GoTo exitSuccess End If Next tdf exitSuccess: Exit Function End Function Private Sub create_hidden_ribbon() 'create hidden ribbon if it does not already exists If Not tableExists("USysRibbons") Then app.CurrentDb.Execute "CREATE TABLE USysRibbons (RibbonName CHAR, RibbonXML Memo);" End If app.DoCmd.SetWarnings False app.DoCmd.RunSQL "DELETE * FROM USysRibbons WHERE RibbonName='HideTheRibbon';" app.DoCmd.RunSQL "INSERT INTO USysRibbons ( RibbonName, RibbonXML ) SELECT 'HideTheRibbon' AS RibbonName, '