Opening an Access db with a parameter (s)

MS Office Access

Opening an Access db with a parameter (s)

Postby Allen » Sat, 29 Nov 2003 05:44:28 GMT

Opening by using a shortcut on the desktop with Target Path
"C:\Test.mdb" FunctionName(ByVal x AS Long)

Re: Opening an Access db with a parameter (s)

Postby Cheryl Fischer » Sat, 29 Nov 2003 08:02:58 GMT

If you want your function to be called when the database opens, go to
Tools|Startup and look for the combo box labeled "Display Form/Page".
Select the form that you want to open when your database opens.  Then, in
the Open event of that form you can call your function.


Re: Opening an Access db with a parameter (s)

Postby Allen » Tue, 02 Dec 2003 10:46:48 GMT

Would like to Pass a value into an Access database using 
a "Shortcut on the Desktop". Create a shortcut to an 
Access database then right click and look at the 
properties, look under the "Target:" box. The path for 
example would be "C:\Test.mdb" ValuePassed. So when the 
user clicks on the shortcut it will pass a value to the 
form (or Function)in Access. I'm using the AutoExec macro 
to open the form right now. Just don't know how to get the 
value from outside to inside access. 
Thank you for your help,
opens, go to
opens.  Then, in


Re: Opening an Access db with a parameter (s)

Postby Cheryl Fischer » Tue, 02 Dec 2003 12:03:58 GMT

In Access Help, check out the topic:  Startup command-line options.  Perhaps
the /cmd option will work for you.

Re: Opening an Access db with a parameter (s)

Postby Allen » Sat, 06 Dec 2003 23:39:21 GMT

I'll try that.
Thank you for your help and time.
line options.  Perhaps

labeled "Display


Similar Threads:

1.Opening second Access DB's form with parameters

I am having problems opening a form in a standalone access 
DB using the the following code - I am able to open the 
second access DB but get an error indicating that ' The 
command or Action OpenForm isn't available now' - Run time 
error 2046.

Private Sub Command21_Click()

Dim strPathName As String
Dim stdocname As String

strPathName = "H:\Projects DB\PO KPI.mdb"
OpenADatabase (strPathName)

End Sub

Public Sub OpenADatabase(ByVal strPath As String)

Set appAccess = CreateObject("Access.Application")

With appAccess
.OpenCurrentDatabase strPath
.Visible = True
End With

appAccess.DoCmd.OpenForm "test", acNormal, , , , 

End Sub

Is it possible to open any form in the second database and 
pass parameters to it (From the first DB?)


2.Open 2007 Access DB from inside Access DB?

I'm not good enough with VB to do what I want:

I want to create a menu with buttons on it that will open other Access 2007 
databases.  The main menu will only include buttons to open the various other 
dbs.  All tables will be in a central location, and will be attached as 

I just don't know enough to do this, and at my age (63), there isn't enough 
time to learn.

Thanks for any help,


3.Cannot edit Access 2007 DB via Form- get "DB opened in Read Only M

I created a custom Sharepoint List view using MS Access 2007 (from Sharepoint 
list, I clicked "Settings", "List Settings", "Create View", "Access View", 
then, once Access launched, I selected the form option "Create a form that 
lets you enter information for one record at a time".).  All columns that I 
created in that list were dumped into the form automatically.  I rearranged 
them as desired, saved and published the form/DB back up to Sharepoint.  
But... no matter where I open the DB (either from Sharepoint, or locally), 
the DB comes up in "Read Only" mode.  Therefore, I cannot enter new records 
in it, in order to update my list.  I can, however, update the list from 
within Sharepoint, without using my Access Form.  

I stepped through the process again to make sure there were no options that 
I could've missed, but do not see anything that seems relevant to this issue. 
 I cannot tell if this problem is related to:
- MS Access security (I have the DB locations added as "Trusted Locations")
- a flag or parameter that I need to change in the code that launches the 
form (doesn't seem that way since it happens even when I launch the form 
- a DB setting that was set when I first created the form (I cannot find 
anything that seems related to that, either)
- or an Access or Sharepoint bug

Any suggestions on this would be very much appreciated. 

4.Open a DB from within another access DB

Hi Iam new to writing code and would like some help in 
opening a database from within an existing database.

The code is as follows:

Function Uploaded()

Dim DB As String
DB = "\\Server\billing\Billing Archive\2004\Datastore 
test Area\Upload.mdb"
OpenDatabase "DB"
End Function

However I get an error code 3024 Could not find file "DB"

Having defined DB as the connect string including the 
database name, where am I going wrong? 

Please accept my thanks in anticipation

rgds Colin

5.Open DB with Open/Read only/Open exclusive/Open exclusive read onl

How could I programmatically open a dialog where user has to define the way 
he/she wants to open the database? Any examples?


6. Access: can't open DB that's already open

7. Access 97 db won't open, says I have it open exclusively

8. Parameters Error With SQL command to Access DB

Return to MS Office Access


Who is online

Users browsing this forum: No registered users and 83 guest