I asked the question in the briefest possible terms, since previous
questions had gone unanswered. I see that I did not provide enough detail
this time.
I have a form for producing a report (in the generic sense of the term
"report", not the Access object). Each report may have links to several
supporting documents. Each one of these links is a separate subform record.
I am using a hyperlink field on the subform for adding links to locations on
our network. It works well enough, but it will be necessary to add the
links in what I think is called UNC format (in other words, using the full
network path rather than mapped drive letters, which are not consisitent
from computer to computer. Not everybody will know how to use the Insert
Hyperlink dialog box, so I am trying to provide instructions. That is the
purpose of the unbound form.
Here's the general setup: The user click a command button to add a link to
a file. An unbound form appears, containing instructions for drilling down
through the network to insert the link. I would like the unbound form to
remain visible along with the Insert Hyperlink dialog box. However, in
order for the Insert Hyperlink dialog box to appear I need to have the focus
in a control bound to a hyperlink field. This is where the difficulty
arises. I cannot pass the focus to that field (by way of the bound control)
while the unbound form is open. I tried the code you suggested. While I
can see the value of the approach, and understand a few things better than I
did previously, in this case what I get is an extra instance of the subform
by itself.
In the meantime I have been working my way toward another solution. I have
created a table (tblLink) with a single hyperlink field, and have bound the
previously unbound form (the one with the instructions, which I will call
frmInsertLink) to that table. To frmInsertLink I have added a text box
bound to the hyperlink field in tblLink. After navigating to the link
(using the Insert Hyperlink dialog box) a command button copies the
hyperlink to the appropriate field on the subform, then closes
frmInsertLink. The next time frmInsertLink is opened the field is cleared.
Am I missing something in your suggestion, or was I remiss in not specifying
that I needed to pass the focus to a subform control? Can I use your
approach to open the main form instead, then navigate to the subform? The
main form has four tab controls (for different sections of the report).
Different tabs will have different subforms. Would this present
difficulties in passing the focus to a particular subform, then the
appropriate control on that subform?
At this point I think my approach of passing the hyperlink from
frmInsertLink is a workable approach, but I can't help wondering if I am
making this more complex than it needs to be.