mrmmickle1
Well-known Member
- Joined
- May 11, 2012
- Messages
- 2,461
I have this code that creates a Database. I am trying to set Tabbed Documents = True but cannot get it to work.... Could someone please point me in the right direction?
This is the code I have (See Below). The red line gets a Run Time Error 91: Object Variable or With Block Variable not set:
This is the code I have (See Below). The red line gets a Run Time Error 91: Object Variable or With Block Variable not set:
Code:
dbConnectStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & DBPath & ";"
[COLOR=#008000] 'Create new database[/COLOR]
[COLOR=#0000ff]Set[/COLOR] Catalog = CreateObject("ADOX.Catalog")
Catalog.Create dbConnectStr
[COLOR=#ff0000][B] CurrentDb.Properties("ShowDocumentTabs").Value = True[/B][/COLOR]
[COLOR=#0000ff]Set[/COLOR] Catalog = Nothing
[COLOR=#0000ff]Call [/COLOR]SetAttr(DBPath, vbNormalNoFocus)