Opening an Access Form from a hyperlink - html

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.

Related

Change path to database in Microsoft Access 2013

I need to make something in the database. It was saved as .accdb files. I copied this from my workplace and now I want to edit it on my home computer, but when I've open these files and tried to see already made commands I got an error message that I have not a valid path. This error occurs while I want to open command forms for adding and deleting, which need to use other databases.
How can I change the path so my Access will know, where these files are stored on my computer?
Go to band option (Database) Tools.
Select Linked Table Manager (label is localized).
Mark the checkbox down-left: Always as for new location.
Click Mark All, then OK.
Input the folder name where the data file exists.

Create a standalone form shortcut in Microsoft Access 2013

I currently have a functioning form that searches through my database by calling a query. What I'm trying to do is turn this into a standalone application where I can simply open a file and only the form opens, running the database on the back-end. I have tried running a macro that opens the form, and I have tried creating a shortcut to my desktop, but nothing has worked.
Does anyone have any suggestions? Anything that will only show the form and the search results would be good (desktop shortcut, HTML file, etc.).
Thanks!
You will need to split your database so that the tables are located in a separate back-end file (which can be kept on a server). These instructions apply to Access 2007 and 2010 but the process is very similar for 2013.
Once this is done, your tables will become linked tables (stored in a separate file) and your front-end .addcb file will only contain queries, forms and reports.
You can control which form opens when the application loads through File -> Options -> Current Database. There are also several other useful controls here for limiting what the user can do; ie.
Hiding the list of database
Hiding the tabs (you will therefore need to create buttons to move between forms)
Hiding the Ribbon and/or status bar
Disabling Layout View
It's safest to change these settings on a copy, so you don't inadvertently lock yourself out; however, by holding down shift when opening the file from within Access, most of these options will be bypassed and you will be able to edit the database / revert these settings should you need to.
In terms of making it a "stand-alone application", it is possible to create a copy that will open without requiring the full version of MS Access on the user's PC (instead using Access Runtime).
I always distribute my front-ends as .accde format (File -> Export ACCDE). The benefits are as follows:
Smaller file size
Optimise memory usage / improves performance
VBA code runs but cannot be viewed or edited
I think what you're looking for is here:
http://office.microsoft.com/en-us/access-help/command-line-switches-for-access-HA010166605.aspx
and
http://office.microsoft.com/en-us/access-help/command-function-HA001228801.aspx
Basic idea, create a macro called AutoExec that checks for a command line argument when opening the database. Setup a shortcut with a command line argument (whatever you decide to name it, I'll use 'lookuponly' as the example.) like this:
"C:\Users\%Username%\Desktop\MyDatabase.mdb" /cmd "lookuponly"
when you double click the shortcut it should auto-run the macro and open your lookup form. Of course under newer versions of access you'll have to set the location of the database as a trusted location or access will attempt to block the database.
http://office.microsoft.com/en-us/access-help/decide-whether-to-trust-a-database-HA010256412.aspx

OpenFile Dialog MS Access 2010

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.

MS Access - Open database form from URL

I'm trying to open a form from an url. This ms access database will be hosted on a shared folder in an network, and the costumer has asked me if it's possible to open an database form (i'll have to pass an ID).
If this were in web environment i would do this without any problem, but honestly in ms access i have no idea how to do this.
Can someone help me?
Have a look at Register protocol and Registering an Application to a URL Protocol. They have a example registry file on how to register a protocol:
REGEDIT4
[HKEY_CLASSES_ROOT\foo]
#="URL:foo Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\foo\shell]
[HKEY_CLASSES_ROOT\foo\shell\open]
[HKEY_CLASSES_ROOT\foo\shell\open\command]
#="\"C:\\Program Files\\Application\\program.exe\" \"%1\""
You can change the last line to something like:
#="\"C:\\Program Files\\Office\\access.exe\" \"C:\\path\\to\\your\\db.mdb\" /cmd \"%1\""
If you URL is foo:241245, the following command is called:
"C:\Program Files\Office\access.exe" "C:\path\to\your\db.mdb" /cmd "241245"
In Access, the commandline arguments are returned by the Command function:
In the direct window:
?Command
241245
The database can be opened from a URL like any other file:
file://server/share/path/database.mdb
This won't work if the database has user-level security on it though. I've only ever done that by using a windows shortcut.
If you're not using user-level security and the URL works, you can set the desired form to open automatically on load by going to the Access Options screen and the Current Database tab, then selecting the desired form from the Display Form drop-down list.
Oops - I just noticed that you said you'd need to pass an ID. I don't know if that's possible using a URL.
Open your Access database from the network location (i.e., with a UNC path, not from a drive letter, or locally).
Navigate so you can see the form listed in your database.
Drag the form to your desktop. A shortcut directly to the form will be created there.
I don't think this is a good idea, though. It's a substitute for a user interface in your Access application. Additionally, your description of the problem sounds like you're intending to have multiple people opening the same database file. This is a really bad practice -- best practice is for the database to be split (back end with data tables only on the server, and individual copy of the front end with forms/reports/etc. on each user's workstation), and more than one user should never be opening the same front end at the same time.

Access options in MS Access 2007

How can I disable the access-options or to hide it?
Update
If you open your MS Access 2007, you usually see the button at the upper left the "Microsoft Office button" and if you click on that, you'll see the different functions like: "new", "save", "open" etc and at the button you'll see the "access options" and "exit".
Make a ACCDE copy of the DB
This will Strip out your VB source (but will leave the compiled code intact).
but first get your menu setting the way you want
e.g.
1. click Access Options->Current Database.
2. Uncheck "Enable Full Menus" for this database
3. From the Database Tools menu, choose "Make ACCDE"
Note Unless you apply a valid digital signature to you DB, Access will warn about VB script and prompt user to Open or cancel good thing is it will quit if they don't accept run VB script but its better to create a digital signature for your DB
Hope this helps
Presumably this is only for the users. You can create a shortcut which the users use on their desktops which has the /runtime command line option. The problem though is you then have to add the path and file name of the msaccess.exe file, ie "C:\Program Files....\msaccess.exe"
Using the free Auto FE Updater makes this entire process a lot easier as well as automatically updating the FE as you make updates available to the users.