Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Common Dialog --Filename

Status
Not open for further replies.

jkejke

Programmer
Jan 18, 2001
35
US
In Visual Basic when I insert the Common Dialog box it has the ability to use the file name of a diskette on the A: drive--In Access 2000 want to do same---however commondialog does not have filename ability--am I overlooking or what?
 
Code:
'I tried this on Access 2002:

Option Compare Database
Option Explicit

Private Sub Command1_Click()
    Dim dlg As FileDialog
    Dim i As Long
    Dim sFile As String
    
    Set dlg = Application.FileDialog(msoFileDialogOpen)
    
    With dlg
        .Show
        For i = 1 To .SelectedItems.Count
            MsgBox .SelectedItems(i)
        Next i
    End With
    
    Set dlg = Nothing
End Sub
 
hi,

I also used "application.filedialog" in an Access 2002 database.

I want to open this database on a computer where Access 2000 is installed, but Access 2000 does not know this command.

Which command can be used in Access 2000 to select folders or paths?

LL

 
The answer is to call the windows API directly.

I did it a few years ago.

You can find the answer in the book "Hardcore Visual Basic" and also some parts in Dan Appleman's book "Visual Basic Programmer's Guide to the Win32 API"

It helps if you have VB6 installed on your computer as it has tools/templates that will help you call the API properly.

The nice thing is you'll never get a goofy license error message from calling the API.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top