word

G

Guest

HI,

i am using word to create letters from within my database. the word
functions allows for a list of templates to be used at will. The templates
will utilise any fields which are stored in the form in which the word
function is added.

When we create a letter we save it to a seperate client file. what i would
Like to do is this;

1. create the letter as current procedure
2. the letter to be saved to the client file (outside of the database)
3. a record of the letter saved into a table within the database, which if
possible will allow the user to click and access the letter without having to
navigate through explorer for it. If it is not possible to click and
navigate then simply keeping a record of the letter will be sufficient.

i understand that i probably need to create a new table (tblLetterHistory)
but how to get an automatic record in there based upon an event i do not know
how to do.

i hope this makes sense and someone can help.

thanks

richard
 
G

Guest

I am not sure if I understand exactly what your trying to do, but, have you
considered using the hyperlink facility within access to point to the word
document record?

Set up a table something like DocumentRecords and select hyperlink from the
field settings. Then its a simple case of entering the path to the Word
Document in the table. Pressing the control on a form with the hyperlink in
will directly start word and lead you direct to the document. No explorer or
searching required. The only thing to consider ia a logical naming routine
for the word documents and a fixed location for them so that you can type in
the hyperlink address directly.

HTH Mike B

--
An Engineers Prayer:
At the very end of the day,
when all else fails,
you have tried all,
you have shouted at and blamed the innocent,
and asked everyone you know,

READ THE INSTRUCTION MANUAL.
 
G

Guest

Hi Mike,

thanks for replying, i didnt really want the users to have to type the path
of the letter each time one is created (we create lots in a day).

if its not possible to have an automated procedure for this then i would be
happy to just have a list of when and which letters have been created to keep
an audit trail. I would possibly like included in this list any type of
document which is created for each client such as an Access report or a pdf (
i have a pdf creator in my programme).

we are a regulated industry so would be good if we could keep a record of
any documents created for a client logging the user, date and time created.

I hope this is a little clearer.

regards

richard
 
G

Guest

Hi Richard

I am still of the opinion that you can in fact use the Hyperlink format.

I have set up a temp Data Base with a couple of Controls associated with the
fields in a table. The User (Me in this case) types the letter name in one
control and VBA behind the control adds the document name to a predefined
path for the Hyperlink Control on the same form. This is in turn saved to the
table field which means you can re-call the address in any other form. In my
case I have designated K Drive just in case you are using networks.

A form for the purpose of associating the document name could be set up to
cope with any form of document you want to save. In my example I have only
designated word documents but it would be easy to add controls for PDF MDB
XLS or any other link.

I have set the path to re-call documents from K:\Reports_2007\Documents\ but
you could make this any path you wish obviously. The code I have used is as
follows:

Private Sub DocumentName_LostFocus()

Dim MyVal, MyHyperAddress As String
MyVal = Me.DocumentName 'Me.DocumentName is the control where the
doc name is typed

MyHyperAddress = "#K:\Reports_2007\Documents" & "\" & MyVal & ".Doc#"

Me.HyperAddress = MyHyperAddress

End Sub

Me.DocumentName Is the control where the user types the Name of the document
or File (Depends on what you want)

Me.HyperAddress Is the Control where the document link is stored

This all works but there is no error trapping (Not my strong point)

You could have the File extension input with the Document/File Name but I
thought it would be better to just type the name and not let the user worry
about the extension.

So how would you do this for other Types of files? I would have a control
for each file type and once the user types in one, it disables the others and
asigns the correct extension in the VBA behind the control. I used the on
lost fucus event of the control DocumentName for placing the code I have
attached above. The code adds a .Doc Extention but another control might
assign a .Pdf extention as example.

I'm really sorry if this is not really how you want to compose your
database, I suggest you re post should it not be.

I wish you the best of luck in the mean time

Kindest Regards

Mike B

If Anyone else reads this and knows where I can gleam info on error
trapping, please let me know. :-{)

--
An Engineers Prayer:
At the very end of the day,
when all else fails,
you have tried all,
you have shouted at and blamed the innocent,
and asked everyone you know,

READ THE INSTRUCTION MANUAL.
 
G

Guest

Hi Mike,

really grateful for this, i will try it tonight and post back how i get on.
looks perfect for me.

regards

richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top