You mentioned that you prefer the API...hopefully not because its easier...
Can you tell me about the built in Dialog? This really should be pretty simple I thought.
Dim dlgSaveAs As FileDialog Set dlgSaveAs = Application.[B]FileDialog[/B]( _ FileDialogType:=msoFileDialogSaveAs) dlgSaveAs.Show
Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
dlgOpen.Show
Debug.Print dlgOpen.SelectedItems(1)
Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
dlgOpen.Show
DoCmd.TransferText acImportDelim, "specNameHere", "TableNameHere", dlgSaveAs.SelectedItems(1)
Nope, with this one you use just the very last one I used and only in the place you are importing the text. It doesn't need to go into a standard module or anything like that.Awesome! Thanks.
So, both pieces of code I need to use, right? Put each one into its own module? Or into the same module? Is one function calling the results of the second?
Thanks again
Hmmmm. I'm now getting "Compile error: User-defined type not defined"
It highlights this section of code:
dlgOpen As FileDialog
Remember you have to set a reference to
Microsoft Office X.0 Objects
(X being 10 for 2002, 11 for 2003, and 12 for 2007)
Wow! I'm turning out to be a real dweeb here. I'm not sure how I do that.
I am using access 2003, but my DB is in Access 2000 file format
No, you ALSO want Microsoft OFFICE 11.0 Object Library checked.Within my references, I have "Microsoft Access 11.0 Object Library" checked. Is this correct?
No, you ALSO want Microsoft OFFICE 11.0 Object Library checked.
It WILL work for you, but you might run into problems if others do not have any Office 2007 apps on their machine.All I have available is 12.0. Will that work?
Got it. I'll make sure all users have at least 11.0 library in their references.
Sorry to bug again. YOu are just such a wealth of knowledge....
Can I default the open to a particular directory?
Public Function CSNImp()
Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
dlgOpen.InitialFileName = "Y:\Access Databases\Import Files to CRM DB\CSN Stores"
dlgOpen.Show
DoCmd.TransferText acImportDelim, "CSSalesTransactions", "ORDERS_CSN_OrderBuffer", dlgSaveAs.SelectedItems(1)
End Function