Chat with a LIVE Microsoft Access Expert!
 
       
 

         

   

Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
 
Chat with a LIVE Microsoft Access Expert!
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-22-2007, 05:34 AM
royalrochelle royalrochelle is offline
Registered User
 
Join Date: May 2007
Posts: 6
royalrochelle is on a distinguished road
Common Dialog Control Not Available

I was trying to use the Common Dialog Control in Access 2003 but I found out it is not available. During my research I found that I need to purchase Visual Basics 6.0 or Visual Studios.Net. I have no problems adding this software to my computer, the only problem I have is, the user doesn't have Visual Basics 6.0 or Visual Studios.Net. If I add the common Dialog Control to my code is does my the user need to install this software too? If so, is there a way I can use the Common Dialog Control without the extra software?

Thanks in advance for any help.
Reply With Quote
Sponsored Links
  #2  
Old 08-22-2007, 06:25 AM
RuralGuy's Avatar
RuralGuy RuralGuy is offline
AWF VIP
 
Join Date: Jul 2005
Location: @ 8300' in the Colorado Rockies
Posts: 11,510
RuralGuy is a jewel in the roughRuralGuy is a jewel in the roughRuralGuy is a jewel in the roughRuralGuy is a jewel in the rough
Send a message via MSN to RuralGuy Send a message via Yahoo to RuralGuy
Use the API instead.
__________________
(RG for short) aka Allan Bunch MS Access MVP acXP, ac07 - WinXP Pro, Win7
Please post back to this Forum so all may benefit.
Teaching is not filling a bucket but lighting a fire.
Reply With Quote
  #3  
Old 08-22-2007, 07:47 AM
royalrochelle royalrochelle is offline
Registered User
 
Join Date: May 2007
Posts: 6
royalrochelle is on a distinguished road
Thank you so much! This worked.
Reply With Quote
  #4  
Old 08-22-2007, 08:01 AM
RuralGuy's Avatar
RuralGuy RuralGuy is offline
AWF VIP
 
Join Date: Jul 2005
Location: @ 8300' in the Colorado Rockies
Posts: 11,510
RuralGuy is a jewel in the roughRuralGuy is a jewel in the roughRuralGuy is a jewel in the roughRuralGuy is a jewel in the rough
Send a message via MSN to RuralGuy Send a message via Yahoo to RuralGuy
Glad I could help.
__________________
(RG for short) aka Allan Bunch MS Access MVP acXP, ac07 - WinXP Pro, Win7
Please post back to this Forum so all may benefit.
Teaching is not filling a bucket but lighting a fire.
Reply With Quote
  #5  
Old 08-22-2007, 06:38 PM
Moniker Moniker is offline
VBA Pro
 
Join Date: Dec 2006
Location: Dallas
Posts: 1,567
Moniker will become famous soon enoughMoniker will become famous soon enough
Err, just add the reference to Microsoft Office x.0 Object Library (where the x is a version number).

This exposes the FileDialog object, and you don't need the 100+ lines of API code. Instead of all that, you would use something like this to open a file:
Code:
Sub OpenFile()

    Dim dlg As FileDialog
    Dim dlgTitle As String
    
    Set dlg = Application.FileDialog(msoFileDialogFilePicker)
    With dlg
        .Filters.Clear
        .Filters.Add "Excel Files", "*.xls"
        .AllowMultiSelect = False
        .Title = "Select the Excel file to import"
        If .Show Then
            fGetFileFolder = .SelectedItems.Item(1)
        End If
    End With
    
    Set dlg = Nothing

End Sub
Once you have the FileDialog declared, just type dlg. and let IntelliSense show you all the things exposed (Filters, Titles, what .Show does, etc.).

I believe you'll find it much more maintainable and easy-to-understand, and if something goes wrong, you won't have to struggle through that API code trying to figure out what might be wrong.
__________________
~Moniker

(If you've been helped by me or anyone else, please add to their reputation by clicking the "scales" icon in the upper-right.)
Reply With Quote
  #6  
Old 08-22-2007, 07:13 PM
RuralGuy's Avatar
RuralGuy RuralGuy is offline
AWF VIP
 
Join Date: Jul 2005
Location: @ 8300' in the Colorado Rockies
Posts: 11,510
RuralGuy is a jewel in the roughRuralGuy is a jewel in the roughRuralGuy is a jewel in the roughRuralGuy is a jewel in the rough
Send a message via MSN to RuralGuy Send a message via Yahoo to RuralGuy
AFAIK, API's do not have versioning problems.
__________________
(RG for short) aka Allan Bunch MS Access MVP acXP, ac07 - WinXP Pro, Win7
Please post back to this Forum so all may benefit.
Teaching is not filling a bucket but lighting a fire.
Reply With Quote
  #7  
Old 08-22-2007, 08:37 PM
Moniker Moniker is offline
VBA Pro
 
Join Date: Dec 2006
Location: Dallas
Posts: 1,567
Moniker will become famous soon enoughMoniker will become famous soon enough
Hmmm...

I've had no issues between Access 2K through 2K7 doing what I suggested, and I'd imagine that the API may be altered a little in Vista (not tested that). I know what you mean in that if I develop in Access 2003 (Office 11.0) and send it to an Access 2000 user (Office 10.0), that can cause issues as the reference will automatically move forward but not backward. Unless you're deploying to multiple versions of Access, the references are not an issue. Even then (and I know this part can get a little complex), you can trap unknown reference errors and correct them.

I get your point though. It's just that the reference is a lot cleaner and easier to debug/maintain should you need to do that.
__________________
~Moniker

(If you've been helped by me or anyone else, please add to their reputation by clicking the "scales" icon in the upper-right.)
Reply With Quote
  #8  
Old 08-22-2007, 11:05 PM
boblarson's Avatar
boblarson boblarson is offline
Has left the building
 
Join Date: Jan 2001
Posts: 19,084
boblarson is a name known to allboblarson is a name known to allboblarson is a name known to allboblarson is a name known to allboblarson is a name known to allboblarson is a name known to all
Quote:
Originally Posted by Moniker View Post
Hmmm...

I've had no issues between Access 2K through 2K7 doing what I suggested, and I'd imagine that the API may be altered a little in Vista (not tested that). I know what you mean in that if I develop in Access 2003 (Office 11.0) and send it to an Access 2000 user (Office 10.0), that can cause issues as the reference will automatically move forward but not backward. Unless you're deploying to multiple versions of Access, the references are not an issue. Even then (and I know this part can get a little complex), you can trap unknown reference errors and correct them.

I get your point though. It's just that the reference is a lot cleaner and easier to debug/maintain should you need to do that.
I've just run into a reference problem with using the Office reference (not my choice - it was done before I got on this project) and I've NEVER had any problems with using the API. So, for my money - I will use the API over setting a reference any day. That's just my preference.
__________________

Bob Larson
Free Access Tutorials and Samples:
http://www.btabdevelopment.com
(and FREE frontend auto update enabling tool)
Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Common Dialog Control sagsh Modules & VBA 6 09-22-2004 11:20 AM
Common Dialog Control result output sagsh Forms 1 09-19-2004 05:03 PM
Common Dialog jriano General 6 12-24-2003 05:29 PM
common dialog control Eland Forms 2 03-31-2003 12:50 PM


All times are GMT -8. The time now is 09:02 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) copyright 2009 Access World