MS Access Compile and Run - ms-access

I am new to MS Access. I am building a simple project and I already have created the tables, forms and queries. My question is, how would I compile and run my program ? Is there "F5-like" to run my project on MS Access ? Or how am I going to do this? Thank you.

In other Microsoft environments, F5 is the shortcut key for "Start Debugging", or "Run", or words to that effect. When the application starts it performs a default action:
Windows forms-based applications will display the startup form
Windows console applications will start running at static void Main()
ASP.NET applications will display the default page (Default.aspx).
Unfortunately, while the VBA development environment does have an F5 shortcut key to run code (and it can be very handy during development), it doesn't mean the same thing as it does in the other environments listed above.
To "run your project" in Access you need to manually perform whatever action you have specified as the default action when the database is opened. That is normally one of two things:
If you have created a Macro named AutoExec then Access will run that, or
If you have specified a startup form (see screenshot below) then Access will open it.
So, to launch your Access project simply open the startup Form or run the AutoExec Macro. (Or, you could always just close the database and re-open it, and let Access perform the default action for you.)

make sure you have ODBC access support to run your program

Related

How can execute flexible search on japers reports?

I'm beginner in hybris. I need to create a jasper reports, using flexible search and mysql server. But I can only use the sql query statement without flexible search in report file (Jrxml source file (.jrxml)).
How can I using the flexible search with mysql?
Are you following the guide provided in Hybris Help for building a custom report? It can be found at https://help.hybris.com/6.3.0/hcd/8b6e40ee86691014b99eda29aebc9d84.html
In the interest of having a source of information in case the link ever becomes dead:
Go to ${HYBRIS_DIR}/hybris/bin/platform
setantenv.bat for Windows or . ./setantenv.sh for Unix/Linux
Go to ${HYBRIS_DIR}/hybris/bin/ext-platform-optional/virtualjdbc
Run the ant command ant dist
Go to ${HYBRIS_DIR}/hybris/temp/hybris/virtualjdbc. You should have two files that have been generated here, hybris-virtualjdbc.jar and vjdbc.jar
You now need to copy these two files to ${HYBRIS_DIR}/hybris/bin/ext-platform-optional/virtualjdbc/lib
Download the Jaspersoft Studio Tool at http://community.jaspersoft.com/project/jaspersoft-studio
Install and Open Jaspersoft Studio
Go to Tools > Options > iReport > Classpath
Click Add JAR twice, each time selecting one of the newly copied JAR files (hybris-virtualjdbc.jar and vjdbc.jar)
Click OK
You now need to setup the Data Source, to do this:
Click on the Report Datasource icon ()
In the newly opened window, click New
Select Database JDBC Connection and click Next
On the next screen you may provide any name for your JDBC Connection
In the JDBC Driver field, make sure you type de.hybris.vjdbc.VirtualDriver
In the JDBC URL field, make sure you type jdbc:hybris:sql:http:///virtualjdbc/service, where is the location of your application server (e.g. https://localhost:9002). Remember this will change with each environment!
Provide a Hybris User for the Username and Password. It may be worth using the admin user to begin with, but make sure you lock it down at a later stage to a user with less access, such as vjdbcReportsUser
Test the connection. Remember you will need the server up and running to be able to use vjdbc
From here onwards, you should be able to create a report using Flexible Search style syntax!

Executing one subroutine without opening Access

I would like to know if there is an easy workaround for my following question. I have an access database that have different modules in vba (and of course each module with different subroutines). How can I do to create an icon or an executable file that by clicking on it it runs one of the subroutines of one of the modules without opening access?
The reason of this is because when I am away people need to run some of these subroutines and these users don't have any experience with Access.
You can start Access with a command line option to run a named Access macro. (That means an Access macro object. Some people also call VBA procedures macros, but an Access macro object is different.)
An Access macro has a RunCode method which you can use to run a VBA function. Since the code you want to run is a subroutine, create a new function which calls that subroutine and shuts down Access afterward, and use the function with the macro's RunCode method.
After you have the macro working correctly, test it from a Windows Command Prompt session following this pattern:
"<path to MSACCESS.EXE>" "<path to db file>" -X <macro name>
After working out those details, you can create a desktop shortcut to do the same thing.
However, if your Access operation must be run by you or another user on a regularly scheduled basis (daily, weekdays only, etc.), you could create a Windows Scheduled Task to do it and forget about other users and desktop shortcuts.
Note this suggestion isn't exactly what you requested because it does open Access. But it could close Access after the operation is finished, so perhaps it will be acceptable.

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

Running MS-Access macro using batch file when not logged in

I have the following set up on a server
Two MS-Access queries
Exported the data from the queries and saved the export steps
Created a macro to run these export steps then exit MS-Access
Created a batch file to open ms-access and run the macro
This works fine and dandy if I log into the server and double click the batch file, but if I set up a scheduled task to "run even if not logged in" then the ms-access macro doesn't seem to run....so it seems like access is never ran.
Does anyone have any ideas? Can you do this sort of process when "not logged in"? Is there something else I need to do? I am really stuck and need to have this automated.
Thanks!
My best guess is that you are trying to access a mapped network location that is not available.
Many networks have logon scripts that map network drives to local drive letters. These logon scripts are not run when you set up a scheduled task to "run even if not logged on."
So if you either:
A) are exporting your query results to a file on a mapped network drive (ie, N:\MyExport.txt) or,
B) have one or more tables in the source of your query that are linked to .mdb's on mapped network drives (ie, CurrentDb.Tables("MyTable").Connect = "N:\MyBackend.mdb")
then the process will fail.
If you are expecting to see an error message when you log on, you won't see one because the Access process is not visible when run through a scheduled task. However, if you go to Task Manager you should see an MSACCESS.EXE process listed.
If this is the problem there are two possible workarounds:
Use UNC paths (ie, \\fileserver\folder\MyExport.txt instead of N:\MyExport.txt)
Set up your scheduled task to run a batch file that:
maps the network drives using NET USE commands
opens your MS Access program with the appropriate command line arguments

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.