FollowHyperlink and BoundColumn problems

E

Edward P Sager

Hello,

I have several ListBoxes which each contain the name of several documents.
I want to be able to select multiple documents and have the documents open
from the hyperlink associated with each document when I click a button.

I am having trouble because two (2) documents are available for opening and
each of two (2) buttons trigger the opening of each respective document
associated with the entries in the ListBoxes, and because of this, the field
in the underlying table must change to reach the associated hyperlink. I
have used BoundColumn to change the column from one Field to another, so as
to get the appropriate hyperlink.

However, I am having a difficulty opening multiple documents. When I do add
the BoundColumn statement, opening multiple selected documents works, but
opening multiple documents does not occur with the BoundColumn code added;
rather, only one (1) document opens with the BoundColumn code added.


When I use the following code, I get only one document to open, even when
many are chosen:

Private Sub cmdOpenDocsSelectedPage2_Click()

'Me.lstPickCasesUsed.BoundColumn = 3
procPlaySound
Me.cmdOpenDocsSelectedPage2.TRANSPARENT = False
Dim varItem As Variant

For Each varItem In lstPickCasesUsed.ItemsSelected
lstPickCasesUsed.BoundColumn = 3
'Do it one of two ways
'Best way is to use ShellExecute but try this quick method first
MsgBox lstPickCasesUsed.ItemData(varItem)
FollowHyperlink lstPickCasesUsed.ItemData(varItem), , True
'If that is no good, then try this
'LaunchApp lstPickCasesUsed.ItemData(varItem), WIN_NORMAL

Next
End Sub

Private Sub cmdShepardizeCasesUsed_Click()
'Me.lstPickCasesUsed.BoundColumn = 5
procPlaySound
Me.cmdShepardizeCasesUsed.TRANSPARENT = False
Dim varItem As Variant

For Each varItem In lstPickCasesUsed.ItemsSelected
'Do it one of two ways
'Best way is to use ShellExecute but try this quick method first
lstPickCasesUsed.BoundColumn = 5
MsgBox lstPickCasesUsed.ItemData(varItem)
FollowHyperlink lstPickCasesUsed.ItemData(varItem), , True
'If that is no good, then try this
'LaunchApp lstPickCasesUsed.ItemData(varItem), WIN_NORMAL
Next
End Sub

Putting lstPickCasesUsed.BoundColumn = 5 (or lstPickCasesUsed.BoundColumn =
3) after the For and before the Next statement opens one selected document
(which document is the correct one), but it seems to eliminate the multiple
entries selected after the first selected document.

Where can I put the lstPickCasesUsed.BoundColumn = 5 statement so that I can
still open multiple-selected documents?

This is my last sticking point for my database.

Thank you,
edsager
 

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