Sara said:
I am apparently just missing something. If it makes any difference, I am
using Access 2007 and trying to bring up Word 97-2003 documents. I
created a
text box. I went into properties for the text box and named it
"mywordDocfield" (without the quotation marks).
you of course can give in a text box any name you want.
I created a button and for
"on click" I chose "code builder" and pasted "Application.FollowHyperlink
me.MyWordDocField" between "Private Sub Docket_Click()" and "End sub"
The above code sample you're giving me tells me that the button you created
was called Docket? I'm not sure if that looks right at all.
I would place a button on the form, don't use the wizard to place this
button on the form.
Now, view the property sheet for this button.
Now click on the event tab of the property sheet.
now click on click of the property sheet
at this point I'm to the right of the property sheet you'll see a little
ellipse thing appear it looks like [...]
click on this ellipse, and you should get 3 options, choose the code option.
Type in that one line of code.
The sequence of steps that you have to take to insert a button, and place
code behind it is outlined here:
http://www.members.shaw.ca/AlbertKallal/wordmerge/Details.htm
(Ignore the first part about setting references, there is a nice sequence of
steps that you have to take to place a button on your form and code behind
it )
If you're more comfortable, I suppose you could also use a macro in this
case, but the it's really only one line of code you have to type in
anyway....
Furthermore, it's not clear if you want the path + link to be saved in that
record. remember, simply placing a text box on a form does not mean what
you typed into that text box will be saved in the table behind (for every
text box you place on a form, you must specify the underlying field from the
table if you want the information typed into this box to be saved). it turns
out that most cases the name of the text box is the same as the underlying
field, but it doesn't have to be.
If you having trouble with the above, then consider creating a hyperlink
field in your table in design mode. You then simply drop that field onto
your form. The result will be a field with the equivalent behavior of the
above, and you'll not have to write code. (the field will actually show as
an underlined hyperlink type field).
Try giving both of the suggestions a try and see which one you like better,
or works for you better...