[mso] Re: Access file open dialog

  • From: "Alan Forster" <Alan.Forster@xxxxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Thu, 12 Dec 2002 08:41:31 +0000

Anthony,

Thanks for the function.  However I think I must need to add a
reference library in VBA.  I can not see which library I need.  Could
you point me in the right direction please?

Thanks,

Alan.

>>> Anthony.Colli@xxxxxxx 11/12/2002 17:57:17 >>>
Alan-

 In Access it's a little different. This function will open the
Windows
Common Dialog and will return the path to the file that the user
selects.
Just place this in a module.

The parameter .InitDir selects the Initial Directory that the Common
Dialog
will open. 

This function returns the path to file as a string like this
"C:\Path\To\File" if you need to use UNC like
"\\server\drive\Path\To\File I
have a function for that too.

-Anthony



-------------------------------------------------------
Public Function getFile() As String
Dim strSource As String
Dim cdl As CommonDialog
Set cdl = New CommonDialog

    With cdl
        .DialogTitle = "Select Database to Copy"
        .Filter = "Access 97/2000 (*.mdb)|*.mdb"
        .CancelError = False
        .InitDir = "C:\My Documents"
        .ShowOpen
    End With
    
    strSource = cdl.FileName
        
    If strSource = "" Then
        MsgBox "Cancel clicked"
        Exit Function
    Else
        MsgBox strSource
    End If
    
getFile = strSource

End Function
---------------------------------------------------------------
 

-----Original Message-----
From: Alan Forster [mailto:Alan.Forster@xxxxxxxxxxx] 
Sent: Wednesday, December 11, 2002 11:55 AM
To: mso@xxxxxxxxxxxxx 
Subject: [mso] Access file open dialog



Hello,

Access 2000 (may have to back save to 97)
I am trying to get the user to specify a filename.  In Excel I use
GetOpenFilename.

Is there a similar function in Access that I am yet to find?

If I use Excel.Application.GetOpenFilename then it opens up in the My
Documents directory, even if I change the current directory and drive
before calling the dialog.  How can I force it to open in the
directory
I want it to?

Any help appreciated,

Cheers,

Alan.


The information in this e-mail is confidential and intended to be
solely for
the use of the addressee(s) and may contain copyright and/or legally
privileged information.  If you are not the addressee (or responsible
for
delivery of the message to the addressee) please e-mail us at
postmaster@xxxxxxxxxxx and delete the message from your computer;
copying,
distribution, use or disclosure of its contents is strictly
prohibited.
As Internet communications are capable of data corruption no
responsibility
is accepted for changes made to this message after it was sent. For
this
reason it may be inappropriate to rely on advice contained in any
e-mail
without obtaining written confirmation of it.
In addition, no liability or responsibility is accepted for viruses and
it
is your responsibility to scan attachments (if any).
Please note that for business purposes, outgoing and incoming emails
from
and to the company may be monitored and recorded.
Mouchel Consulting Ltd, Registered Office : West Hall, Parvis Road,
West
Byfleet, Surrey UK KT14 6EZ Registered No : 1686040

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx
or
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx 

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx?Subject=unsubscribe 

Or, visit the group's homepage and use the dropdown menu.  This will
also
allow you to change your email settings to digest or vacation (no
mail).
//www.freelists.org/webpage/mso 

To be able to use the files section for sharing files with the group,
send a
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an
invitation
with instructions.  Once you are a member of the files group, you can
go
here to upload/download files:
http://www.smartgroups.com/vault/msofiles 
*************************************************************


*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx
or MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx 

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx?Subject=unsubscribe 

Or, visit the group's homepage and use the dropdown menu.  This will
also allow you to change your email settings to digest or vacation (no
mail).
//www.freelists.org/webpage/mso 

To be able to use the files section for sharing files with the group,
send a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an
invitation with instructions.  Once you are a member of the files group,
you can go here to upload/download files:
http://www.smartgroups.com/vault/msofiles 
*************************************************************


The information in this e-mail is confidential and intended to be solely for 
the use of the addressee(s) and may contain copyright and/or legally privileged 
information.  If you are not the addressee (or responsible for delivery of the 
message to the addressee) please e-mail us at postmaster@xxxxxxxxxxx and delete 
the message from your computer; copying, distribution, use or disclosure of its 
contents is strictly prohibited.
As Internet communications are capable of data corruption no responsibility is 
accepted for changes made to this message after it was sent. For this reason it 
may be inappropriate to rely on advice contained in any e-mail without 
obtaining written confirmation of it.
In addition, no liability or responsibility is accepted for viruses and it is 
your responsibility to scan attachments (if any).
Please note that for business purposes, outgoing and incoming emails from and 
to the company may be monitored and recorded.
Mouchel Consulting Ltd, Registered Office : West Hall, Parvis Road, West 
Byfleet, Surrey UK KT14 6EZ Registered No : 1686040

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx?Subject=unsubscribe

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: