var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Here's one for all you dbForum'ers out there:
This company gets sent a *.ORD file every week (basically a *.txt with a funny extension) that needs importing into an access database table.
But as you may be aware - Access dislikes anything that's not a proper text file.
So here is my problem: Without manually renaming the extension of the file in question - can I run this import?
Can I force access to accept this file as a deliminated text file?
Can I have access copy the file >> rename it >> run import >> delete the copied file (change to a.txt so acecss is happy).?
Example text file:
Item Code, Description, Price
1, item1 desciption, 10.00
2, item2 description, 11.00
3, item3 description, 9.50
4, item4 description, 10.00
Please note that when I manually rename the file to .txt and run the above code, Access is happy.
DoCmd.TransferText acImportDelim, , "Products", <full file path>, True
Sadly, I cannot ask the users to rename the file for selection - because that would be far too easy!
Any help/suggestions/comments welcomed!
Perhaps something like this
Dim FName As String
FName = "Your Path & File Name"
TempFName = Left(FName, Len(FName) - 4) & ".txt"
Name FName As TempFName
DoCmd.TransferText acImportDelim, , "Products", TempFName, True
Name TempFName As FName
Any good ?
One after thought, you may need a delay while the name change is performed !!??
You are astud muffin!
That does exactly what I wanted
I might have to ask a few more questions in a minute when the project goes tits up though :P
Told you I'd be back...
To run my code I have to turn on Microsoft Office 10.0 Object Library (or 11.0) I.e. Tools >> References >> Microsoft Office 10.0 Object Library.
Now, when it comes to give this to the customer I can almost guarentee the code will fall over because MSO 10.0 Object library is not turned on.
Is there anyway in VB code that I can turn the object library on? Or if I simply send them the database will my settings still apply?
Hope this makes sense!