VBA in templates vs documents

nsmoller

New member
Local time
Today, 13:38
Joined
May 3, 2007
Messages
3
Here's our scenario.

Basically, my template allows me to create "master formula" documents.
The documents are saved based on the formula name.
When i open the document, it is printed and used as a "preparation worksheet". We need to manually enter the lot number on the worksheet now, and it is a time vacuum. So i'm looking for a way to automate that.

SO... i thought that...

i would use an access DB that holds these lot numbers. When each "master formula" document is opened, it would go through the steps of auto inserting the lot numbers.

1. Create Template
2. Open Template as Document
3. Fill out Document, save as "Master Formula"
4. Later, open "Master Formula" document and have it auto insert lot numbers
5. Print the document, have it clear the lots and/or NOT save the document changes.

can i create the code in the template and have it change stuff in the document? cause its not working now as i'm doing it.

the final document should have an ingredient, a hidden ingredient id (using white text), and a lot number.

The vba will grab from access a list of potential lot numbers based on that ingredient ID. the user selects which one is used, then that lot is entered into the document.

currently the vba does the lot grab when i'm editing the template, but not in the document.

any guidance would be appreciated!

Thanks
 

Users who are viewing this thread

Back
Top Bottom