Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Importing / Linking / June 2005

Tip: Looking for answers? Try searching our database.

How do I prompt for a parameter when I want to import using a macr

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ginger - 29 Jun 2005 20:32 GMT
I am using the transferdatabase action in a macro. I will be importing
several dozen files that only vary by a single name. How can I use a variable
in the database name argument that prompts the user for a parameter?
Van T. Dinh - 30 Jun 2005 02:30 GMT
If I recall correctly (I haven't touched Macros in years), you can use the
InputBox() function in the "Database Name" argument to ask the user to enter
the full path of the database file.

Signature

HTH
Van T. Dinh
MVP (Access)

> I am using the transferdatabase action in a macro. I will be importing
> several dozen files that only vary by a single name. How can I use a variable
> in the database name argument that prompts the user for a parameter?
ginger - 30 Jun 2005 02:43 GMT
Thank you. Can you tell me how I would then carry that through so I would not
have to prompt the user 43 more times?

> If I recall correctly (I haven't touched Macros in years), you can use the
> InputBox() function in the "Database Name" argument to ask the user to enter
[quoted text clipped - 4 lines]
> variable
> > in the database name argument that prompts the user for a parameter?
Van T. Dinh - 30 Jun 2005 03:26 GMT
43 times for 43 files???  (You did write "files" in your original post.)

Are you importing different Objects from a _single_ database files?

Signature

HTH
Van T. Dinh
MVP (Access)

> Thank you. Can you tell me how I would then carry that through so I would not
> have to prompt the user 43 more times?
ginger - 30 Jun 2005 15:56 GMT
I am sorry if I mislead you, I am not very experienced. I have 43 field
offices with 6 databases. Inside each database is 1 table I want imported. So
I want to repeat the field office name 5 times after it is entered once.

> 43 times for 43 files???  (You did write "files" in your original post.)
>
[quoted text clipped - 3 lines]
> not
> > have to prompt the user 43 more times?
John Nurick - 30 Jun 2005 07:18 GMT
Use something like this for the filename argument:

="C:\My Folder\ABC" & InputBox("Enter the middle part of the filename")
& "XYZ.mdb"

>I am using the transferdatabase action in a macro. I will be importing
>several dozen files that only vary by a single name. How can I use a variable
>in the database name argument that prompts the user for a parameter?

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
ginger - 30 Jun 2005 14:55 GMT
Thanks. That worked great. But now I need to know how to use that input
parameter for the next 4 filename arguments, since they will be the same?

> Use something like this for the filename argument:
>
[quoted text clipped - 9 lines]
>
> Please respond in the newgroup and not by email.
ginger - 30 Jun 2005 15:56 GMT
Let me clarify, I have 43 field offices with 6 databases. Inside each
database is 1 table I want imported. So I want to repeat the field office
name 5 times after it is entered once.

> Use something like this for the filename argument:
>
[quoted text clipped - 9 lines]
>
> Please respond in the newgroup and not by email.
John Nurick - 30 Jun 2005 22:04 GMT
To do this with a macro you'll need a form with a textbox on it. Let's
call the form frmF and the textbox txtOffice. Put the field office name
in the textbox.

Then, in the macro you repeat the TransferDatabase action six times. To
get the field office name, use
    =[Forms]![frmF]![txtOffice]

>Let me clarify, I have 43 field offices with 6 databases. Inside each
>database is 1 table I want imported. So I want to repeat the field office
[quoted text clipped - 13 lines]
>>
>> Please respond in the newgroup and not by email.

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.