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?
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?
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.