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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Common Dialog 15

Status
Not open for further replies.

ninash

Technical User
Jul 6, 2001
163
0
0
GB
Hi All,

Is it possible to use something like Common Dialog within Access?
If so How do I add it and use it for something like saving paths to files I want to use???

Thanks in advance

Tony
 
Tony,

Can you please post the code you are using for the calling function (the code for your button_Click event). Maybe I can see where you are going wrong. Regards,
gkprogrammer
 
Hi Again,

I have got it to work now but only by putting an extra line in as you will see from the code.

Private Sub Command2_Click()
Dim strFileName As String 'this will contain the file path

strFileName = Module1.ShowOpen("Path2File")
Me![Path2File] = strFileName

End Sub

everything works fine now...

tony
 
Tony,

You should be doing this:

Me![Path2File] = Module1.ShowOpen("Title")

The bolded text (Title), above, is not the name of the control that will equal the path, it is the actual title that is displayed on the dialog box when it appears. Look at the top of the dialog box when it appears, the way you have it now it will display Path2File. I'm sure you would prefer something like Find File. Regards,
gkprogrammer
 
Derrrrrrr

See I told you I was going dumb

Sorry about all the hastle
Have another star and thanks for the lesson and buckets of help

Tony
 
gkprogrammer,
I found this tread when looking for a good answer for the same kind of problem I have. The code you've shown would be great only I got the following error when compiling:
Procedure declaration does not mach description of event or procedure having the same name. It then stops at the line : Private Sub Class_Initialize(Title As String)
I'm not so familiar with these class events. What could be going wrong?
Thanks
 
Hi Aydan,

For ease of use paste the above code into a module not a class module and it should work just fine. Regards,
gkprogrammer
 
Hi again GKProgrammer,
I managed to make it work! :) Stupid from me to not having named the class_initialize to my MyClassName_initialize.
It works great! You deserve a at least one more star [wink]
Bye for now,
A.
 
FancyPrairie:

I have a routine that uses a number of Word merge documents to create the standard forms we use with our clients. Right now, I have the path statement hardcoded but this presents problems if the folder is not created using the naming conventions we have established.

I'm trying to set this up to allow the user to select the Folder into which to place the new documents. I have used your code to define the initial directory (R:\Resident\Units) and this works fine when the dialog opens. I can then open a specific unit folder and then a specific resident folder. However, I don't know how to exit the dialog at this point and pass that path value to the text box.

How do I get your code to place the completed path (i.e., R:\Resident\Units\UnitName\ResidentName)into my text box without specifying a file?

Thanks in advance.

Larry De Laruelle
ldelaruelle@familychildrenscenter.org

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top