Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 146
  • Last Modified:

How to get a File Import Dialog box

I want to prompt the user to choose the files he/she wants to import using a dialogbox.
0
bhanly
Asked:
bhanly
1 Solution
 
twardCommented:
Use the CommonDialog Component.

CommonDialog1.ShowOpen
0
 
DalinCommented:
bhanly,
Drop a commanDialog Control to your form, name it comdial, drop a text box in the form, then add a command button to the form, in the click event add the code:


On Error GoTo FileErrorHandler

'Get the File Name from the user
'Get a file name From the User
comdial.DialogTitle = Title
comdial.Filter = "All Files|*.*"
comdial.Action = 2
Text1 = comdial.filename

Exit Sub

FileErrorHandler:
Err.Clear
Resume Next

End Sub
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now