473,405 Members | 2,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Open Dialog filter problem?

My database code works on my server and one laptop, but does not function correctly on two other laptops, all four systems run Vista Business and MSaccess 2007. The code is set up to display the file path in the open dialog file name box, that way the user clicks a button on a form, the open dialog box pops up, and the user just hits enter to open the file (the only reason the dialog box pops up is if the user wants to open a different file) since the file path is already selected. This works on 2 different computers, a server and a stand alone. My problem is that on two other stand alone computers, only the folder path is opened, and the user has to search through many files manually. I am assuming it is some type of a filter setting somewhere...but what would cause this? Even on the two computers that do not work, the filename path is correct, it isn't making it to the file name box in the open dialog screen.

Brian
May 1 '09 #1
14 4245
ChipR
1,287 Expert 1GB
Just for a start, what is the code you're using?
May 1 '09 #2
ChipR,

Here is a sample of what I'm using...pretty much if there is a file associated with the record, open that file path...it works great on 2 of my computers but the other 2, only the folder path is opened...and I have to search manually through a lot of files...

Expand|Select|Wrap|Line Numbers
  1. If checklist_file > "" Then
  2.         openfilepath = openfilepath & checklist_file
  3.     Else
  4.         If asTemplate = True Then
  5.             openfilepath = openfilepath & DLookup("cfgValue", "_config", "cfgname='mastertemplate'")
  6.         Else
  7.             openfilepath = openfilepath & "*.xml"
  8.         End If
  9.     End If
  10.     Set fd = Application.FileDialog(1)
  11.     fd.initialfilename = openfilepath
  12.     fd.allowmultiselect = False
  13.     fd.show
  14.     If fd.selecteditems.Count <> 1 Then
  15.         checklist_file = ""
  16.     Else
  17.         checklist_file = fd.selecteditems(1)
  18.     End If
Brian
May 1 '09 #3
ChipR
1,287 Expert 1GB
I'm not sure what version of Access you're using, but the 2003 reference says that msoFileDialogOpen is not supported. Maybe try:
Expand|Select|Wrap|Line Numbers
  1. Set fd = Application.FileDialog(3) 'msoFileDialogFilePicker.
May 1 '09 #4
DonRayner
489 Expert 256MB
On Vista if you install your front-end db into "Program Files" you may be having problems with Data Redirection sending you to an old version of the Database.

If that's the case, this link should be able to offer you some insights.
May 1 '09 #5
Chip,

I tried your suggestion with negative the same results on my laptop. I also tried the database on another computer with 2003 and the original code worked there as well.

Don,

I do have the database and all associated files under the user documents folder. I will look into permissions to see if that may have anything to do with it but I can write new data to the tables...All of my config paths load correctly, it is strange that just this dialog box doesn't want to play nice. I was wondering if the newer laptops might have a different dll library or something that isn't executing the code as it should...
May 1 '09 #6
ChipR
1,287 Expert 1GB
Can we assume that all the systems are accessing the same recordset, then opening to the same directory on a server? Have you double checked the contents of openfilepath just before trying to show the dialog on the machines where it isn't working correctly?
May 1 '09 #7
Denburt
1,356 Expert 1GB
You might want to check it could possibly be the wild card character especially since you are using 2007 it could be an ANSI standard issue.

http://office.microsoft.com/en-us/ac...766011033.aspx


openfilepath = openfilepath & "*.xml"
May 1 '09 #8
chip,

I have used the watchlist to see that the entire file path was loaded into openfilepath...then when I step to open the dialog box, all I get is the folder path...I even checked a few lines of code later and still have the correct file path in openfilepath...it's almost like it is being filtered to the folder level...

Denburt,

Do you still think that it would be that line of code since I have the file name in the checklist_file variable and it skips those few lines under the else statement...

openfilepath = "C:\Users\Certifications\Documents\Certifications\ checklist\1319_Inmarsat Mini-M.xml"

which is the correct path...the dialog box is just cutting off the file name at the end...
May 1 '09 #9
ChipR
1,287 Expert 1GB
I'm stumped. In my test, even a file that didn't actually exist would still automatically be put into the File Name box of the open dialog.
May 1 '09 #10
I know...I'm there too...especially since I know that the code works...I'm thinking that it is something about the laptops...filter or setting or library that isn't liking the msofiledialogfolderpicker...if I put a 2 instead of a 1 or 3, it tries to save the file and puts the right file name under the file name edit control...which is what I want but in reverse, I want it to do that and open a file...but neither 1 or 3 seem to do anything...

I'm looking into the msofiledialogfolderpicker right now...where does it get its parameters from...is this a library?
May 1 '09 #11
Denburt
1,356 Expert 1GB
Well I am going to agree that it must be a version of a dll or something in the way of corruption however if it doesn't seem to be a wild card issue and it is happening on a defined path then you may consider several things. The file you are using "C:\Users\Certifications\Documents\Certificati ons\ checklist\1319_Inmarsat Mini-M.xml" Has a space an underscore and dash, perhaps if you remove those then test it. I know it shouldn't be an issue but you just may be surprised... I have had tables with two underscores in the name that would do the strangest things, again it shouldn't have been an issue but it was, I had to completely restructure a whole DB one time.
May 1 '09 #12
NeoPa
32,556 Expert Mod 16PB
Brian,
As a final check, can you trace through the code on two separate PCs (one which does, and one which doesn't work) and post :
  1. The line of code.
  2. The value of each variable referenced in the line of code.
Please ensure everything possible is done to make both versions are as similar as possible.

PS. In case you need assistance with tracing see Debugging in VBA.
May 2 '09 #13
I'm out of the office for the next two weeks, I'll try running the script and compare between a good cpu and one it doesn't run on when I get back in...
May 3 '09 #14
NeoPa
32,556 Expert Mod 16PB
That's fine.

We'll catch up when you get back :)
May 5 '09 #15

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jim | last post by:
I am trying to import a file using a file spec from the Access File Open dialog... I have been out to http://www.mvps.org/access/api/api0001.htm to look at the code, but because I'm not a guru, I...
2
by: Pat Richey | last post by:
i'm trying to make an open and a save file dialog that allows you to open/save various formats, but when you change the extension you want to filter the file list disappears until you leave the...
3
by: GrantS | last post by:
I am needing to permit users to select files using the 'Open file' common dialog box. The format of the names of the files are along the names of: GB00((&X.001.jpg I am not able to show these...
2
by: Don Peters | last post by:
I'm relatively new to ASP.NET. I'm running it under Win XP Pro, using Visual Studio 2002.NET (haven't migrated to VS2003 yet). The ASP.NET application I'm having a problem with was initially set...
2
by: OutdoorGuy | last post by:
Greetings, I have a "newbie" question in relation to opening files from C#. I have a Windows form where I allow the user to type in a file extension in a text box (e.g., "xls"). I then take...
1
by: sirimanna | last post by:
I want to know how can i open some text file data using microsoft common dialog control.6 I know how to save text data using microsoft common dialog control.6 code are here, ...
0
by: Kelii | last post by:
Evenlater, Yeah, I don't open the report in preview mode when I setup my recordsource, filters, or sorts. Before I give my solution, I would say that your code will be simpler if you drop the...
7
by: Peter | last post by:
ASP.NET 2.0 I am trying to open a Word document and Excel document from a dialog web page, what's the best way to do that? I have tried the following: Response.Clear();...
4
by: manojspromantr | last post by:
Hi Friends I am trying to design a form where i need to browse a excel file using a open dialog box & append the same in a Table at the database.Any how i have taken care that the Table fields are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.