Solved

How to get a File Import Dialog box

Posted on 1998-07-27
2
136 Views
Last Modified: 2010-05-03
I want to prompt the user to choose the files he/she wants to import using a dialogbox.
0
Comment
Question by:bhanly
2 Comments
 
LVL 7

Accepted Solution

by:
tward earned 100 total points
ID: 1466841
Use the CommonDialog Component.

CommonDialog1.ShowOpen
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1466842
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now