Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2006
    Posts
    60

    Unanswered: Giving Aditional Commands To A Command (If That Makes Sense)

    Hi,

    I have made a little database to store a heap of our information at work. 1 thing it does is store 'transmittals' for us. This data can be 'automatically' imported from the program we use. It creates a text file. In the text file the different columns are seperated by $ symbols.

    I have used the command RunCommand acCmdImport when i push a button, but i want to pass some other commands onto the dialog box that comes up. The user needs to select there text file (although i can make this 'generic' everytime). But then, every file is always delimited, then special seperator $ then tick the box "Use First Row As Column Names", then i put it in a table "Transmittal Info" then click finsih. How can i make this automatic? Commands like this can be passed on in excel but i dunno about Access.

  2. #2
    Join Date
    Mar 2004
    Location
    Berlin, Germany
    Posts
    107

    nasty ..

    solution .. use sendkeys. otherwise try docmd.transfertext function

    best regards
    D

  3. #3
    Join Date
    Feb 2006
    Posts
    60
    okay the send keys didn't work because i couldn't get it to send the keys whilst it was in the import command.

    but the TransferText function worked perfectly.

    Only problem i have now is the location (and name) of the actual file. Is there a way to make a box (like the open/explore box) come up so the user can find the file. This would then give the "Location" of the file which i can use in the transfertext function

    DoCmd.TransferText acImportDelim, "Import Specifications", "Transmittal Info", Location, -1

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Good going on dumping send keys - they are a last resort.

    As it happens a recent poster on this site started precisely where you are trying to get to. Check out this thread. I think you will find some interesting stuff at post 17

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Feb 2006
    Posts
    60
    okay that looks good in that rain database, im copying it over slowly into my own. Its getting a slight bit confusing though cause i have never used 'common function'/made my own functions. Its starting to come together slowly. I'll get back to you soon (i cant finish it off right now) and tell you how it goes.

  6. #6
    Join Date
    Feb 2006
    Posts
    60
    ok i got it sorted, i just copied the whole module. But im unsure which bits i really need, can you tell me.

    i have developed another small problem though. When i first made my database it was just 1 file. Now it has a front and back end. When i import the data it doesn't show the table i want to put the info in (when manually going to File > Get External Data > Import) as it is a linked table. To overcome this i made a temporary table in the front end database file. The data from my text file is imported here, then it opens that table, cuts all the data, then opens the linked table and pastes the data. Then it closes the table. Obviously this is a pretty dodgy method, and it also comes up with 3 prompts during this process (it asks are you sure you want to delete these records, then are you sure you want to paste these records, then do you want to keep all the info on the clipboard). Even though the linked table is not visible in the Import dialogue, could i still put the table in the TransferText settings? Any other ways of getting my info straight into the linked table?

  7. #7
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Look up debugging, breakpoints and stepping through code on the web. This will allow you to follow code execution line by line. It will also be one of the most valuable tools in your locker for fixing buggy code.

    Quote Originally Posted by neRok
    Even though the linked table is not visible in the Import dialogue, could i still put the table in the TransferText settings?
    Why not try and see?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  8. #8
    Join Date
    Feb 2006
    Posts
    60
    i been fiddling and developed another problem. I have made some new forms, linked some new tables. Then it randomly started saying 'Error Accessing File. Network Connection May Have Been Lost". How do i fix this and stop it happening. It has happened before and the only fix i could find was starting again with a backed up copy (which i do everytime i go to make a change to the front end now incase this happens. luckily the first time it ever happened was in the morning and i had a backup from the night before)

  9. #9
    Join Date
    Feb 2006
    Posts
    60
    anyone know? this is a real problem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •