Solved

Common Dialog ocx

Posted on 1998-06-03
5
393 Views
Last Modified: 2008-03-04
ACCESS: 97
CommonDialog control: version 5.0
I want to retrieve some file names trough a standard Windows Open File Dialog.
Using the CommonDialog OCX I just got the filename without the complete path.
Why this is happening once I can get the entire path using the same OCX in Visual Basic?
How can I retrieve a file name whit the entire path from an ACCESS form?
0
Comment
Question by:ssa060398
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

by:Helicopter
ID: 1974821
I know it's no help, but mine is working as it should from within Access. Could you give any more details?
0
 

Author Comment

by:ssa060398
ID: 1974822
OK! I need to fill a field with a complete file name. Now, I'm using a command button that calls the Open dialog box setting the OCX's action property to 1, as I do in VB. But after choose the file, CommonDialog.FileName contains only the file name (file.txt)and not the complete path (c:\temp\file.txt) as happens in VB.

0
 
LVL 1

Accepted Solution

by:
CEBAKA earned 50 total points
ID: 1974823
I think that you use a wrong statement

You should use :

Make sure that you do

dummy=commondialogobject.ShowOpen
and then :
strfilename=commondialogobject.filename and then you get the path.This should work.
But when this is not happening something is wrong with the ocx.

Question
Do you use the 32 bit version ocx ?


0
 

Author Comment

by:ssa060398
ID: 1974824
Did make no difference use ShowOpen instead Action.
But when I was checking the OCX version (and now I'm sure that it's 32bit OCX!!) I've noted that a 16 bit OpenDialog was been opening.
Sounds a little bit weird???? But that's the fact: When you use the &H1000 (File must exist) the 32bit OCX shows a 16bit Open Dialog window and retrieves jus the file name without the complete path.
Your answer didn't solve my question directly, but by your clue, you got your points!!

Thanx!!
0
 
LVL 1

Expert Comment

by:CEBAKA
ID: 1974825
Thank you for your grade !!

I had the same problem as you did couple months ago
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

735 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