Backdoor to unhide db container

Win10 LO6.4.7 HSQ 2.51

Hi,

At long last I managed to get rid of the dbcontainer using the code below
(the container still pops up for a second, can live with that.

Sub DBOpen(Optional poEvent As Object)
	If GlobalScope.BasicLibraries.hasByName("Access2Base") Then
		GlobalScope.BasicLibraries.loadLibrary("Access2Base")
	End If
	Call Application.OpenConnection(ThisDatabaseDocument)
	Call hdb
End Sub

Sub hdb
Const acForm = 2
Const acDatabaseWindow = 102
	DoCmd.SetHiddenAttribute(acDatabaseWindow)
	Call Menu_Main
End Sub

Just wondering how to build in some backdoor to reverse the DoCmd.SetHiddenAttribute(acDatabaseWindow)
and how to do that without A2B

Link above

Thanks for your thoughts

Hello,

I do try to stay away from Access2Base.

In this post (How to I create a Base application that will start-up on a switchboard form?) is a sample which starts the Base file hidden (also visible for a moment). That post also contains a link back to the original code. So using (and cleaning up my code a bit) my previous sample, made the ‘app’ a global variable and created a small Sub to set it back to visible.

From the form Ctrl+Alt+R will make the main Base form visible again.

Sample ---- OpenHidden.odb

Hi @ Ratslinger,

Thank you for that. Previously had a look at the original. The problem there is if you open a report from a form button, closing the report will actually close the calling form as well…

Can only say that if that happens, something is designed incorrectly.

Edit:

Just did a quick test. Yes form closed. Will examine further.

@gkick,

There seems to be some bug there. I could close the report without the form closing by using another macro from a button. With oReport global (from the open statement), command was oReport.close(1). Now this isn’t an answer or any kind of work around (at least in my opinion) but it shows there is a problem and should be reported as a bug.

Edit:

Just tried your Access2Base opening and the results are the same.

Well I guess some interim work around could be to call the backdoor minimized followed by calling the report and hiding the db after the report closes, trouble is reports don’t have events.

Have tried a number of methods including threading in Python. Each time results were the same. Close the report & calling form closes. Right now no more suggestions.

@Ratslinger Someone has been burning the midnight oil…
WIll file a bug report. How did you open the oReport as global?

added bug tdf#140134 not sure if correctly

Quick look seems bug report OK.

Global Variable (top of page outside of any Sub/Function) -

global oReportDoc as Object

Line in code -

oReportDoc = Thisdatabasedocument.reportdocuments.getbyname("YOUR_REPORT").open

that’s it.

Thanks @ Ratslinger

@Ratslinger

There is a workaround/solution for Windows using a brief vbs script as shown under this link
[Solved] Getting rid of the main window (View topic) • Apache OpenOffice Community Forum (written by Nocton halfway down the page
)
Seems to work well on my machine WIN10.
Would imagine Mac/Linux having some similar scripting tools

@gkick,

From the post:

The vbs script runs in Windows

Linux doesn’t contain vbs. No solution here and probably not for Mac.