Office Systems Blog

Joao Livio 2002 - 2008 Portugal

Dialog Box in Microsoft Access (Find File)

 '(c) 2002 João Tito Lívio
'This code can only be use as a part of an Application and could not be sell

 'To REQUEST a full functional sample please > Click

1. Insert a DialogBox ActiveX in your Form.

In Design View go INSERT - ActiveX CONTROL

2. Rename the control to "cdlg"

3. Paste the Code to a CLICK event of a Commad Button

CODE

    Dim strCaminho As String
    With Me.cdlg
            'Initial Directory
            .InitDir = "C:\"
            'Dialog Title
            .DialogTitle = "Localizar Arquivo"
            'Filter File Types
            .Filter = "Arquivos(*.txt)|*.txt|All Files (*.*)|*.*"
            .ShowOpen
            'Return File and Path to a Variable
            strCaminho = .FileName
    End With
    MsgBox "Path: " & strCaminho

SAMPLE

Comments

Stephane said:

Thanks nice notes

# October 17, 2006 11:26 AM

Dylan CSL said:

Nice sample

Regards,

Dylan

# September 10, 2007 11:57 PM

Michael said:

Thanks.

Very useful and easy to implement.

Michael

# December 30, 2007 11:31 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)