No, just change my throw-away example code, the MsgBox, with your real code,
the FileDialog.

Signature
---
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
> Hey Bob,
> Thanks again. I got that to work with the form that I have but I don't
[quoted text clipped - 53 lines]
>> >
>> > Thanks
Ayo - 31 Aug 2007 22:42 GMT
Thanks for everything so far Bob, but I am going to ask for your help once
more if you don't mind. It seems I take 5 steps forward and three steps back.
It looked like I got it to work the way it should then all of a sudden, it's
not working any more. I guess I need someone else to look the code over for
me and maybe see what I don't see. I would reaally appreciate it if you can
look at this and maybe tell me what I am doing wrong.
Thanks
Ayo
Option Explicit
Public WithEvents mButtonGroup As msforms.CommandButton
Private Sub mButtonGroup_Click()
Dim btn_num As String
'MsgBox mButtonGroup.Caption & " has been pressed"
btn_num = Right(mButtonGroup.Name, Len(mButtonGroup.Name) - 6)
assignFiles btn_num
End Sub
Sub assignFiles(btn_num As String)
Dim getFolder As String
Dim fl As FileDialog
Dim ctl As Control
Dim vrtSelectedItem As Variant
Set fl = Application.FileDialog(msoFileDialogFilePicker) '.InitialFileName
With fl
For Each ctl In frmOpenFiles.Controls
If TypeName(ctl) = "TextBox" Then
If Len(ctl.Name) = 6 Then
If Right(ctl.Name, 1) = btn_num Then GoTo Get_File
ElseIf Len(ctl.Name) = 7 Then
If Right(ctl.Name, 2) = btn_num Then GoTo Get_File
End If
End If
Exit Sub
Next ctl
Get_File:
.InitialFileName = ctl.Value
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
getFolder = vrtSelectedItem
Next vrtSelectedItem
End If
If getFolder = Empty Then
MsgBox "You Must select a file to continue. Please Try Again."
Exit Sub
ElseIf getFolder <> Empty Then
ctl.Text = getFolder
End If
End With
End Sub
> No, just change my throw-away example code, the MsgBox, with your real code,
> the FileDialog.
[quoted text clipped - 56 lines]
> >> >
> >> > Thanks