| Chat with a LIVE Microsoft
Access Expert! |
||||
|
||||
|
#1
|
|||
|
|||
|
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. |
| Sponsored Links |
|
#3
|
|||
|
|||
|
Thank you so much! This worked.
![]() |
|
#4
|
||||
|
||||
|
Glad I could help.
__________________
(RG for short) aka Allan Bunch MS Access MVP acXP, ac07 - WinXP Pro, Win7Please post back to this Forum so all may benefit. Teaching is not filling a bucket but lighting a fire. |
|
#5
|
|||
|
|||
|
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
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.) |
|
#6
|
||||
|
||||
|
AFAIK, API's do not have versioning problems.
__________________
(RG for short) aka Allan Bunch MS Access MVP acXP, ac07 - WinXP Pro, Win7Please post back to this Forum so all may benefit. Teaching is not filling a bucket but lighting a fire. |
|
#7
|
|||
|
|||
|
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.) |
|
#8
|
||||
|
||||
|
Quote:
__________________
Thanks, Bob Larson Free samples, tools and tutorials (including Auto Frontend Update Enabling Tool) "Have you tried turning it off and on again?" |
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Common Dialog Control | sagsh | Modules & VBA | 6 | 09-22-2004 10:20 AM |
| Common Dialog Control result output | sagsh | Forms | 1 | 09-19-2004 04:03 PM |
| Common Dialog | jriano | General | 6 | 12-24-2003 04:29 PM |
| common dialog control | Eland | Forms | 2 | 03-31-2003 11:50 AM |