Bill Patten
bill_Patten at earthlink.net
Wed Oct 18 14:06:36 CDT 2006
Hi Martin, Could the space between Customer and Details.txt be causing your problem? It used to in the old DOS days. Bill ----- Original Message ----- From: "Martin Reid" <mwp.reid at qub.ac.uk> To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com> Sent: Wednesday, October 18, 2006 11:46 AM Subject: Re: [AccessD] Load from test AGAIN Its fails on this line Application.LoadFromText acForm, Mid(strTemp, InStr(1, strTemp, "_", vbTextCompare) + 1), "C:\forms\" & strTemp strTemp has the value Form_Customer Details.txt coming into the loop Never gets past this. The error is The object name 'Customer Details.txt' does not follow Microsoft Access object naming rules I get the feeling the answer is staring me in the face here. If I do a simple application.LoadFromText then its not a problem. But if I have 500 objects I would like to automate the process and just grab them all. Martin Martin WP Reid Training and Assessment Unit Riddle Hall Belfast tel: 02890 974477 ________________________________ From: accessd-bounces at databaseadvisors.com on behalf of Charlotte Foust Sent: Wed 18/10/2006 19:34 To: Access Developers discussion and problem solving Subject: Re: [AccessD] Load from test AGAIN You don't give any specifics on where your problem occurs, Martin. Is it in the file system object handling, the LoadFromText, or what? I've usually had fewer problems with any kind of iterative operation on files when I created an array of the filenames (with or without extensions) to be retrieved using Dir or file system object and then passed that into a routine to do the actual handling, with some kind of test in place to see if one item has succeeded before passing in another item. Charlotte Foust -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Martin Reid Sent: Wednesday, October 18, 2006 11:11 AM To: Access Developers discussion and problem solving Subject: [AccessD] Load from test AGAIN Ok this has me beat No matter what I try I cant get it to loop through a folder and import the exported text files. Tried Martys stuff, Drews stuff and my own. Used file system object to return only the file name without the extension and no luck. Any help greatly appreciated. background Access database objects exported as text files into C\|Forms I think need to LoadFromText all the objects in said folder back into database. This cannot be as difficult as it seems. One at a time and naming the files it works. Only when I go to look through all the objects does it fail. This is almost my last example file I need and its melting my head. Martin Martin WP Reid Training and Assessment Unit Riddle Hall Belfast tel: 02890 974477 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com <http://www.databaseadvisors.com/> -------------------------------------------------------------------------------- -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com