Access Invisible

asnyder

Registered User.
Local time
Today, 20:53
Joined
Jan 28, 2002
Messages
24
I am using the following code to open a password protected database. I know the code is working, because if I misspell the database or form name I get an error that the database or form is missing or doesn't exist, but I can't see the access window or the form. Please help.

Option Compare Database

Dim appAccess As Access.Application
Sub OpenTest()
Const strConPathToDB = "P:\test.mdb"
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase "P:\test.mdb", , "test"
appAccess.DoCmd.OpenForm "Main Menu"

End Sub
 
You have the wrong arguments for this line...
Code:
appAccess.OpenCurrentDatabase "P:\test.mdb", , "test"

That line only allows for a boolean like...
Code:
appAccess.OpenCurrentDatabase "P:\test.mdb",False
to open the db as exclusive or not.
 
ghudson said:
You have the wrong arguments for this line...
Code:
appAccess.OpenCurrentDatabase "P:\test.mdb", , "test"

That line only allows for a boolean like...
Code:
appAccess.OpenCurrentDatabase "P:\test.mdb",False
to open the db as exclusive or not.


"test" is the password and is an optional string for the command.
 
grappling with Visible and Enabled

Look for visible and enabled attributes on the form or for some ability to refresh the display.
 
Dim appAccess As Access.Application

Sub OpenTest()
Const myPath = "Y:\nwData.mdb"
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase myPath
appAccess.Visible = True
End Sub
 
Thanks

lagbolt said:
Dim appAccess As Access.Application

Sub OpenTest()
Const myPath = "Y:\nwData.mdb"
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase myPath
appAccess.Visible = True
End Sub



Thanks, that worked.
 

Users who are viewing this thread

Back
Top Bottom