Question A macro to copy form to a file? Please help!

Another way to do this, subject to appearance requirements, is to have Access put the data into Bookmarks in Word.

Basically, Access would open the Word doc you have as a template, fill in the bookmarks and then save the active Word doc with a file name that would include date/time and perhaps the name of the client and if applicable the type of document and it would then close the template without saving it. So the file name might look like:

2009-07-30_04-59-15_JohnSmith_Invoice or whatever. You could also include in the code what is required to email the resulting Word document.

To maintain a constant appearance that is not determined by the length of the data entry (such as a name) you can put the Word bookmarks into Word tables. You can if required make more than one template and which one is opened is determined by an entry in one of your Access fields.

It can take some time and be quite fiddly to set this up with formatting issues in Word etc but once done it gives a top result. Actually, I owe some of my success in this area to Adam (ajetrumpet) with me getting on the phone at 3am Australian time:D

That sounds amazing! Being able to save all my data as it is in Word should be exactly what I need. I just don't know how to, that's the reason I've asked Adam to help me out. There's no one here that knows Access even one bit, so Adam's like the only person who can walkthrough me. I know I'm a pain in the butt, but I hope Adam will explain to me what I have to do. I'll do whatever needed, I really would like to learn. :)
 
That sounds amazing! Being able to save all my data as it is in Word should be exactly what I need. I just don't know how to, that's the reason I've asked Adam to help me out. There's no one here that knows Access even one bit, so Adam's like the only person who can walkthrough me. I know I'm a pain in the butt, but I hope Adam will explain to me what I have to do. I'll do whatever needed, I really would like to learn. :)

Firstly, you need to have a go yourself. I can guarantee you that anyone here that can do any of this sort of stuff irrespective of what it is will have spent many times on the keyboard as the sun is rising:D

If you search around on both this site and Google there is a ton of stuff on Access to Word. You can also come the other way. That is, Access opens the Word doc and inserts data, then you might change some of it, perhaps spelling of a name or address and then when Word is closed the data is sent back to Access.

You can also have queries in Word that are linked which means they are "live" and with the appropriate formatting they data will look just as if you typed it into Word.

You will find if you get the basics yourself, such as in this case being able to open Word from Access and insert something into a Bookmark then it becomes much easier for someone to help. There is also more keeness to help if you know what I mean.

And as a bonus, your searching around will give you a bunch of other stuff which will be very useful even though it is not in the same area.
 
And just to increase your appetite a bit more:

You can have Access do the email of the Word doc as an attachment and you can also use the Word doc to for the body of the email and with the Word formatting. Looks much the same as if you went to the Word doc and did Select All>>Copy and then pasted it into the email. Looks good if you have a coloured background for the Word doc.

That should keep you up for a couple of nights:D
 
the trouble is, printing a form is not usual. if you want to print a receipt, then really you need to design a report to do this, and add a button to your form to print this receipt.

now, if you can reprint this directly from your database at any time, its hard to see why you would want to store it outside the database

however one simple way of doing what you want, is to send it as an email - just file/send will send it as an attachment to an email in a variety of formats.
 
the trouble is, printing a form is not usual. if you want to print a receipt, then really you need to design a report to do this, and add a button to your form to print this receipt.

now, if you can reprint this directly from your database at any time, its hard to see why you would want to store it outside the database

however one simple way of doing what you want, is to send it as an email - just file/send will send it as an attachment to an email in a variety of formats.

I cannot reprint this any time, because I've got unbound fields on my form, so they are not being saved anywhere.
That's why I need to be able to save the form with all the data in it somewhere, because in the minute I close the form - I lose all the data.
 
Save the unbound fields in the database. You can do that via ADO/DAO or you can bind them to fields in a table designed to hold your final invoice data. There are a lot of ways to skin this cat, though it is my belief that going with an external program to hold data is the wrong thing to do. Hold data in a database, format data with other tools.
 
Save the unbound fields in the database. You can do that via ADO/DAO or you can bind them to fields in a table designed to hold your final invoice data. There are a lot of ways to skin this cat, though it is my belief that going with an external program to hold data is the wrong thing to do. Hold data in a database, format data with other tools.

ADO/ADO? Care to instruct me please? Can I save the entire form data all together? Bound and unbound fields?
 
In every business transaction, there becomes a point of no return when the business has been finalized. In one company I worked for, at that point the "Invoice" record was marked with "Final" as it's status and all relevant data to reproduce the invoice was saved in the invoice header and detail line item records, including the extended totals.

You can either do this by designing your forms to use bound controls that are "locked" when the invoice is "finalized", or you can continue to use unbound controls (see post number 25 and extrapolate for your definition of bound and unbound) and write a VBA subroutine that connects directly to the tables in question via ADO or DAO (look them up).
 

Users who are viewing this thread

Back
Top Bottom