Unanswered: Giving Aditional Commands To A Command (If That Makes Sense)
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.
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
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.
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?
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.
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?
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)