Ok, I have a question. I don't know in which PC the user is going to execute the application, maybe he doesn't have permission to write in the folder I indicate.
What can I do?
By the way, I am looking for how to execute the print dos command with the shell library. Any website which help me?
Hey Hammbakka, thanks for your help. But the Print you told me doesn't work. Now that I have the PrintOut.txt in my system, how can I print it from VBAccess? uffffff, so difficult, I am searching and searching, it must be easy
Thanks a lot hammbakka. I got it using Ctrl+P. So the window of the printer is open, and then you print, perfect!
Ok, now I am struggling my brains in that: I don't want to leave the txt I print in the system, I want to delete it, cause it's not very nice that a file appears in the desktop like a magic event and stays there. So, do you have an idea of how can I delete it after print. Cause the thing is, I have a function which deletes files, but I cannot delete the file since is open to print. If I use SendKeys ALT+F4 after SendKeys Ctrl+P then it closes the printer window, cause is the printer window which has the focus.
So, do you have any idea? Maybe it is not very good to do all this actions by means of VB, I have the hazard that the user close the aplication or something happens during the development of all these actions and my job fails.
The problem is that I haven't found any other way to print, because the Printer object doesn't exist in VB for Access.
Please, stay with me!! I am in mountain of shit. :-)
Sorry, I have no Idea how to do that, because when the print window comes, and you close it after printing, you will lose the control from your vbAccess. You must do it another way. What was wrong with the print Command?
why don't you try to import this text file in a Table (this will be as only one Record, because it is not comma separated values) then make a report, print it and then delete the .txt file from your Desktop.
there is no need to write your data in a text file, just write them to a table then make the reoport and print it