Open a DB with a variable.

Kenln

Registered User.
Local time
Today, 15:53
Joined
Oct 11, 2006
Messages
551
I use
Code:
Set db = acc.DBEngine.OpenDatabase(strDbName, False, False, Access_PW)
acc.OpenCurrentDatabase strDbName

Which is a Microsoft example of how to open a password protected db.

I am curious, using the example above (with modification) is there any way to send the db I wish to open a variable.

Similar to opening a form with arguments.

Thank you,
 
send a variable to the database itself BEFORE it is even open?

You might have to explain that logic a bit more to get an answer...
 
Variables don't exist until the program starts and initializes them. I think you may need a better explanation of what you are trying to accomplish, just like Adam asked.
 
I have actually gone another direction.

I wanted to send an argument to Access when I open it.
i.e.

I am running DB_A which calls DB_B.
but DB_B check for an argument and if present preforms an action such as opening a form and navigating to a specific record.

I was looking for a simple way to accomplish this and still allow them to be standalone. The easist was I see is to link both of them to a common table.

Thanks,
 
As an idea:

I'd have a table in DB_B that DB_A updates before opening it. The table could contain a form name and an id.

On the opening of DB_B, get it to check that table. If there is a record there, go to that form and that id (record), then delete the record. If blank - open as normal.

Pete.
 

Users who are viewing this thread

Back
Top Bottom