OpenFile Dialog MS Access 2010 - ms-access

I followed the suggestion by Cody Gray about halfway down the page in this thread but I'm having no luck.
Unless I'm missing something, this is supposed to allow me to navigate from Access, using the Windows API Dialog Box, to the relevant folder and open a file, no? I'm trying to open a Word doc which has a Mail Merge coming back to the same Access Db. I needed the dialog because there are multiple files that may be selected at different times.
I added all the suggested code and while the process runs without error, when I get to the final step, the selected file doesn't open. Nothing happens.
I realize this is not much help without an error message. Any thoughts nonetheless?

As I understand the situation, you have code which uses a string variable named strFileToOpen to hold the path to a Ms Word document. And now you want to open that file in Word.
You can use the FollowHyperlink method.
Application.FollowHyperlink strFileToOpen
Look at the Access help topic for that method. It offers other options you may wish to use.
Also I suggest you look at the help topic for FileDialog Object. It is simpler than the Windows APi method in the code you linked.

Related

Opening an Access Form from a hyperlink

We currently have an ASP/SQl Server system, which has an option to send an e-mail to a user. This e-mail contains a hyperlink to another ASP page, which shows a specific database record.
I'm currently working on a resilience version of the system, which is MS Access based. The user's would like to keep the same functionality, and have an e-mail which contains a hyperlink back to the database, opening a specific form and filtering it to a record.
I believe the solution lies somewhere in using Command() to get the parameters from the command line, however I am actually having difficulty currently opening the database itself. The code i'm currently using is:
<a href="C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.exe
H:\Access DB\11th March\Link to DB\Dealer
Startup Admin EU v10.mdb" >
TEST
</a>
I think this should open the Dealer Startup database, however it is failing stating the file cannot be found. If I remove the second step i.e. H:\Access DB etc. the link opens Access, so I am wondering if i'm doing something syntactically incorrect? The file path definitely seems right.
Also would someone be able to give some advice on the use of /c in a hyperlink? The small amount of information I have found seems to suggest it doesn't work but if someone could clarify or give me an example of how to do it I would appreciate it
Thanks,
Chris
I managed to create a solution to this problem. I could not find a direct way to open the Access DB from a hyperlink, however you can hyperlink to a shortcut. The workaround I therefore used was to create a shortcut to the database using the following syntax:
"file path to ms access" "file path to database" /cmd Args
so for example:
"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.exe" "C:\Documents and Settings\Database.mdb" /cmd Args
Creating a shortcut to this file path opens the database. I then created an autoexec macro which opened a specified form if the Command() function returned Args. This meant that when opening the database normally you would be taken to the usual form, but when opening from the shortcut you will be taken to a different form.
I then created the e-mail hyperlink to the shortcut.
I have created a batch file to delete browser history for MSIE and kept it on the server-side. When the user clicks on 'delete browser history' hyperlink, I just make him download this file, and the user runs it manually.
You can also do something similar.

Opendoc link to a folder

I'm using BO XI 3 and wanted to know if is possible to open an InfoView folder using an OpenDocument link?
For example, every item in InfoView has a CUID. So to open a web intelligence report I could do the following:
http://Server_name:6060/OpenDocument/opendoc/openDocument.jsp?iDocID=ABCDEFGHIJKLMNOPQRST&sIDType=CUID
Folders in InfoView also have a CUID, so is it possible to link to them using this method to take a user straight into the folder? Whenever I try I get an error message (An error has occurred: An error occurred while trying to view the document), is there a way around this?
I'm guessing the answer will be "OpenDocument is for opening documents, not folders". Thought I'd ask anyway...
I don't believe so, for this reason: the openDocument.jsp/.aspx command is really just running an object, so it's expecting either a report object, or an instance (in .rpt .pdf .rtf .xls, etc) that it can either render or open in another application. Although a folder is a legitimate object w/ a CUID, it isn't something you "run/view" - rather it is something you browse.
Cheers!
Stefan
http://www.sdn.sap.com/irj/boc/index?rid=/webcontent/uuid/5001d5de-f867-2b10-00bf-8d27683c85a0#section5

Open an external file with a button on a form in Access 2007

I am creating a database for my Unit (I am in the Army) and I need a button that will launch a file when clicked. The file is a .xfdl file used for military forms in a program called PureEdge. Is this possible and how would I go about doing it. I have searched it as much as I know how, but it seems that my Google-Fu is failing me.
Thanks for any help.
If the file type is associated with the program, that is, the file will launch when clicked, then FollowHyperlink may suit, otherwise, you may need to use Shell. For example:
Call Shell("""C:\Program Files\Microsoft Office\Office14\msaccess.exe"" ""c:\docs\db.mdb""", vbNormalFocus)

access 2007 bug - intermittent query parameter prompts

I am working on an Access 2007 application that was created by someone else. It has a strange, intermittent bug in which it prompts the user for query parameters when the main form is opened. The query parameters are clearly not necessary, because the error does not always occur.
The very strange "fix" to this problem is to open and close a particular module before opening the main form. Then the form opens without parameter prompts. However, of course I can't ask end users to open and close modules.
I tried using a macro to open and close the module when the database is opened. That fixes the bug, but leaves the VBA code window open, so that's no good.
Has anyone run into anything like this before? Any suggested solutions, workarounds, debugging tips, etc?
If you use the "Database Documenter" feature and check "yes" to all the options, you will obtain an exhaustive report that should let you trap your problem parameter. Export this report as an .rtf or .pdf document, so it is searchable. Identify a keyword from the dialog prompt, and search on that.
Once you check the query objects using the Documenter, check your VBA code. You'll do this by stepping through code in the IDE. If the main form has subforms, they are opened with (within) the main form. And they load before the main form.
Identify those subforms.
Sprinkle
breakpoints in their code modules
(if you find a Load function, that
is highly relevant).
If the main form has a
code module, do the same there.
Have a look for global variables in the module that needs to be opened and closed or any variable that is referenced in the module belonging to the form.
Access displays the Enter Parameter Value dialog box when you open an object that contains an identifier or expression that Access cannot interpret. You need to determine the source object. Here's a step-by-step guide:
http://office.microsoft.com/en-us/access-help/why-does-access-want-me-to-enter-a-parameter-value-HA010274377.aspx

create a customised openFileDialog

i have an access program which i have been working on and i want to create a openFileDialog which will show specific folders and files. For e.g. when you click a button, instead of having the dialog showing all the folders and files, it will be given a parameter (folder name) and it will show only that folder. i am trying to achieve something similar to the windows search engine. the reason is that, my program has a folder which contains around 1000 sub folders which contain a documents. each subfolder has the same name as the document it contains. therefore, what i an trying to achieve is that from my Access Form, the user can click a button, and a dialog will pop up showing only the folder which contains the document the user is working on.
is this possible.
i would really appreciate your help thank you
Do you mean you want OpenFileDialog to start in a specific folder?
You can do it like this:
OpenFileDialog MyOpenFileDialog = new OpenFileDialog();
MyOpenFileDialog.InitialDirectory = "C:\Path\To\My\Selected\Subfolder" ;
MyOpenFileDialog.ShowDialog()
Access provides Application.FileDialog. If you want to use the ENUM for the dialog type, you'll have to add a reference to the Office Object library, but if you try to use the enum you'll get prompted and Access will add the reference for you. It's not much use, though, as it can otherwise be used quite easily with object variables instead of strongly-typed variables.
To learn how to use it, open the Immediate Window (Ctrl-G), type Application.FileDialog, and hit F1. That explains the basics.
For what it's worth, I was using Windows API code from the Access Developers Handbook before the Application.FileDialog was introduced (with A2002), so I continue to use that. I am pretty sure the functionality is identical, though Application.FileDialog probably has a spiffier interface (I don't know -- I don't use it!).