Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I am using the OpenCurrentDatabase method with the following code: Sub Pref(seeit As Boolean, openit As Boolean) Dim PrefPath As String 'Path of pref.mdb PrefPath = ThisWorkbook.Path & "\pref.mdb" 'Open Access and make it visible when seeit=true Set oApp = CreateObject("Access.Application") oApp.Visible = seeit 'open pref.mdb oApp.OpenCurrentDatabase PrefPath 'open the following query oApp.DoCmd.OpenQuery "qAppendFax" oApp.DoCmd.OpenQuery "qDeleteFax" oApp.DoCmd.OpenQuery "qAppendTeor" oApp.DoCmd.OpenQuery "qdeleteTeor" 'open the fax form if openit=true If openit Then oApp.DoCmd.OpenForm "fax" End If 'closes db oApp.CloseCurrentDatabase Set oApp = Nothing End Sub the boolean argument seeit allows to show or to hide the Access window while openit allows to skip the opening of the "fax" form. My issue is that when the two arguments are both set on true Access don't stays open on the form but closes immediately. This event don't happen if the two statements oApp.CloseCurrentDatabase Set oApp = Nothing are omitted. Are these two statements necessary, or I get the same result closing the Access window manually? Moreover is it possible to get the Access window open maximized? Emiliano |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using ADO from Excel form to relational Access Db | Excel Programming | |||
Access Form to Excel sheet | Excel Discussion (Misc queries) | |||
moving an Access form to Excel | Excel Programming | |||
Add a value from Excel to a form in access | Excel Programming | |||
get access form in excel | Excel Discussion (Misc queries) |