hi,
i am creating a form with a text field and two command buttons in vb 6.0
I want when somebody will click on command1 button a path will be shown in the text field.
And for second command button i want when somebody clicks in it, Data will be updated in an access file as we receive excel files on daily basis.
for command1 i did following but gettting an error of object required and it gets highlighted on Set fd = Application.FileDialog(msoFileDialogFilePicker)
Private Sub Command1_Click()
Const conVerticalOnly As Integer = 2
'Declare a variable as a FileDialog object.
Dim fd As FileDialog, strFilesSelected As String
Set fd = Application.FileDialog(msoFileDialogFilePicker)
'Declare a variable to contain the path, it must be a Variant because
'of the For..Each construct requires it
Dim vrtSelectedItem As Variant
With fd
.AllowMultiSelect = True
.Title = "Browse Files"
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
strFilesSelected = strFilesSelected & vrtSelectedItem & vbCrLf
Next vrtSelectedItem
Else
'The user pressed Cancel
End If
End With
Set fd = Nothing
Me![txtDisplayFileNames ].ScrollBars = conVerticalOnly
Me![txtDisplayFileNames] = strFilesSelect
End Sub
for command button2 i am not geting any idea how to go ahead.
KIndly help me.
i have also added Microsoft office 11.0 object library.