Hi Jorge,
I think you will have to use VBA. That is what the version
of Visual Basic is called that comes with Access from Access
97 and up. Visual Basic for Applications.
You're three quarters of the way there with the conversion
of your macro into VBA. Now go and have a look at the
TransferText method and the InputBox function in Access
Help.
Particularly look at the arguments for TransferText. In
your case what you want is the 'filename'.
Here's an example to look at which I'll then edit to get the
message:
******************
Function mcrExport()
On Error GoTo mcrExport_Err
DoCmd.TransferText acExportDelim, "", "Customers", _
"c:\nicktemp\cust.txt",
True, ""
mcrExport_Exit:
Exit Function
mcrExport_Err:
MsgBox Err.Description
Resume mcrExport_Exit
End Function
********************
Now the edited version:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Function mcrExport()
Dim strQualFile as String 'Qualified file name
On Error GoTo mcrExport_Err
strQualFile = InputBox ("Type in target path and file
name: ", _
"Input Name")
DoCmd.TransferText acExportDelim, "", "Customers", _
strQualFile,
True, ""
mcrExport_Exit:
Exit Function
mcrExport_Err:
MsgBox Error$
Resume mcrExport_Exit
End Function
!!!!!!!!!!!!!!!!!!!!!!!!!!!
I've deliberately used InputBox rather than the browse
functions I first mentioned because it is a lot simpler to
explain and use, though less flexible.
You'll need to change bits of the code above to suit your
circumstances.
Good luck.
--
Nick Coe (UK)
AccHelp v1.01 Access Application Help File Builder
http://www.alphacos.co.uk/
Download Free Demo Copy
----