Open the another access file in minimized or hidden

kowol

Registered User.
Local time
Today, 07:42
Joined
Apr 23, 2012
Messages
16
I found below script from the forum but the objApp.Visible = False doesn't work.
Any help would be appreciated.

Thanks

Private Sub Form_Load()

Dim objApp As Access.Application
Set objApp = New Access.Application
objApp.UserControl = True
objApp.OpenCurrentDatabase "Q:\Barcode\Update.accdb"
objApp.Visible = False

End Sub
 
You have a few options.

What are you trying to accomplish by opening it in hidden mode?

If you're trying to retrieve or input data, typically you could connect via DAO and not open the database via the application window at all.

ie.
set db = Opendatabase(nameofdatabase)
set rs = db.openrecordset(nameoftable)
rs("fieldname") = "newvalue!"
myvariable = rs("fieldname")

<do stuff>

rs.close
db.close
set rs = nothing
set db = nothing

Also:

I found below script from the forum but the objApp.Visible = False doesn't work.
Any help would be appreciated.

Thanks

Private Sub Form_Load()

Dim objApp As Access.Application
Set objApp = New Access.Application
objApp.UserControl = True
objApp.OpenCurrentDatabase "Q:\Barcode\Update.accdb"
objApp.Visible = False

End Sub

- You can't give UserControl = True to an application which is not visible.
- You'd want to declare the application Visible = False, prior to opening up a database window.
 
First, I have a little experience with Access so I just used that code how it works.
Anyway, I have two database files.
One is for the data input and the 2nd file has a form with Timer interval to update the local table from sql database through ODBC connection.
What I want is the 2nd Access file to be opened minimize so that working in background.

Thanks
 
First, I have a little experience with Access so I just used that code how it works.
Anyway, I have two database files.
One is for the data input and the 2nd file has a form with Timer interval to update the local table from sql database through ODBC connection.
What I want is the 2nd Access file to be opened minimize so that working in background.

Thanks

Why not combine both databases into a single database and hide the timer form?
 
I made it separate file because it takes too long to update.
And I don't want to wait till update query finises.
 

Users who are viewing this thread

Back
Top Bottom