Mark A Matte
markamatte at hotmail.com
Wed Oct 18 14:46:40 CDT 2006
Martin, I'm stabbing at this...but I've done a lot automation and looping around importing files...granted I haven't ever used loadfromtext...but why is the object listed in your error different than the value of strTemp: strTemp="Form_Customer Details.txt " ErrorObject="Customer Details.txt" Is it not being passed correctly? Mark A. Matte >From: "Martin Reid" <mwp.reid at qub.ac.uk> >Reply-To: Access Developers discussion and problem >solving<accessd at databaseadvisors.com> >To: "Access Developers discussion and problem >solving"<accessd at databaseadvisors.com> >Subject: Re: [AccessD] Load from test AGAIN >Date: Wed, 18 Oct 2006 20:26:08 +0100 > >No joy folks. > >Did the quotes wrote a function that stripped the spaces and still errors. > >I am screwing up here somewhere. > >Maritn > >Martin WP Reid >Training and Assessment Unit >Riddle Hall >Belfast > >tel: 02890 974477 > > >________________________________ > >From: accessd-bounces at databaseadvisors.com on behalf of Bobby Heid >Sent: Wed 18/10/2006 20:08 >To: 'Access Developers discussion and problem solving' >Subject: Re: [AccessD] Load from test AGAIN > > > >Martin, > >Could it be that you need to surround the whole file path+file name with >quotes? There are spaces in your file name. > >Maybe: > Application.LoadFromText acForm, Mid(strTemp, InStr(1, strTemp, "_", >vbTextCompare) + 1), "'C:\forms\" & strTemp & "'" > >Just a WAG. > >Bobby > >-----Original Message----- >From: accessd-bounces at databaseadvisors.com >[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Martin Reid >Sent: Wednesday, October 18, 2006 2:47 PM >To: Access Developers discussion and problem solving >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 _________________________________________________________________ Get FREE company branded e-mail accounts and business Web site from Microsoft Office Live http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/